Overriding Magento core
Posted on October 12, 2012 by Nimrod Techn There have been 0 comments
Repeat after me. we never, ever, ever, ever - change Magento's core files (app/code/core).
Why? lots of reasons. the most important one is, we would like to upgrade our Magento system at some point.
The best of practices would be to create a directory in app/code/local named Mage (app/code/local/Mage).
Now copy the core file to the exact same directory hierarchy (create the same hierarchy), on local.
Which means, if the file we would like to copy is at app/code/core/Mage/catalog/controllers/IndexController.php, we would copy it to app/code/local/Mage/catalog/controllers/IndexController.php.
Blocks, controllers, helpers - can be copied like this without a problem.
Models, however, require you to develop a Magento extension with slight modifications.
This post was posted in Writing a Magento Extension