In Magento, when we wish to create custom module to meet our needs, we always comes across the need of overriding its core files. There are a few means for overriding magento core files and I would like to discuss a process to achieve this without creating a custom module.

To override magento core files, it is not necessary to create your own module and write xml in config.xml. Instead just copy the core file, which you want to edit/override and paste in ‘app/code/local/Mage’ . Lets start by editing the file, magento will read your file instead of the core file. Suppose as an example if you need to override ‘app/code/core/Mage/Catalog/Block/Product.php’ you need it to put in Product.php ‘app/code/local/Mage/Catalog/Block/Product.php’. Now, magento will read your file inside local folder and this process is known as overriding Magento core functionality.

There are some factors to be considered which opting this approach :

For one thing, we must override the complete core file and copy all the class functions. Once the overridden file is in place, this will be the file will be used instead of magento core file always.
This approach can be used only when you’re testing/developing your module.

Instead of writing a whole module, you can quickly override the core class see if things work well.

Know More About This Topic from our Techies

Post By : Chinju Thomas (4 Posts)

"Chinju is the Project Lead in Cubet Techno Labs with 5.9 years of experience in Web Technologies. She strives to do her best in everything she attempts. She is skilled in PHP, Wordpress, Magento, Joomla, WHMCS, Mean.js, Angular.js, Mongodb, MySQL. Everything she knows came from self-study, going through tutorials and analyzing code ."


You might also like...

INDIA OFFICE

info@cubettech.com
+91 484 4054324
Skype : cubettech
Leela Info Park,
Unit IX-C, 9th floor PhaseIV,
Kochi, Kerala, India

LONDON OFFICE

info@cubettech.com
+44 2071938618
Skype : cubettech
Kemp House
160 City Road
London- EC1V2NX, UK.
Top