Magento: Overriding Helpers

You can override helper in Magento in following way.
Steps to Override helper in Magento:
1) When we override the helper in the module, we should not change the core helper files directly. To do this, we add following xml in config.xml inside the our custom module:

2) We create a new custom class in our helper folder at path app/code/local/Mynamespace/Test/Helper/Data.php in our custom module.

class Mynamespace_Test_Helper_Data extends Mage_Customer_Helper_Data
Thats’s it! You have overrided the core helper ‘Mage_Customer_Helper_Data’.

Note: We can only override the classes for which objects can be created. We can not override the abstract classes for which no object is created.

Leave a Reply