Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i want rewrite magento helper core class Mage_Core_Helper_Data. I have try below code, but it is not working

<?xml version="1.0" ?>

Can any one tell why is not working?

share|improve this question
can any one tell why i got down vote on this question – Amit Bera Jan 16 '15 at 12:27
up vote 8 down vote accepted

When you rewrite a helper class, it will only take effect when you use Mage::helper('...').

However, most helper classes extend from Mage_Core_Helper_Data directly and then, the original class is used :(

For example:

class My_Custom_Helper_Class extends Mage_Core_Helper_Data {

If you want to rewrite such a class in all cases, you can use the ugly method to copy it into app/code/local/Mage/Core/Helper/Data.php and do your edits there.

It is not nice style, but if you want to extend a class very high up in the hierarchy, you have no other choice as far as I know.

share|improve this answer

protected by Amit Bera Nov 21 '14 at 12:25

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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