1

I'm a newbie using magento 2, and i'm trying to modify a custom module (MercadoPago), i'm modifying the PHP file i need to modify but when I reload the page it doesn't seem to work.

I tried the same thing with a Hello world module, modifying its php files and the changes are still not made when i reload the page.

I tried using

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:flush

But doesn't work. How can i make my changes goes live on my site? I don't want to create a new module to replace the existing one neither want to change the version, i just want to modify some few lines of code.

I hope you can help me, thanks.

1

If you are running your system on developer mode: - If you are using magento 2.0.x and 2.1.x - clear root/var/generated/ folder contents - If you are using Magento 2.2.x - clear root/generated/ folder contents

If you are running it on the production mode: - rm -rf generated/*; php bin/magento setup:di:compile; php bin/magento cache:clean;

Kind suggest, before working on something huge like Magento 2 - read basics - what is deployment modes, how they are working, some basic rules (technical guidelines) and etc.

More over I suggeest to extend module using either a dependency injection or plugins. That would save you from changes loss when module is updated.

  • 1
    Thank you so much, i'm aware of the risks of modifying the module itself instead of creating a new one that replaces the templates – Macr1408 Feb 6 '18 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.