I want add a function to the core class. To do this I have added a file to extend the class core but when I call the function it's returning nothing.


1 Answer 1


for this you need to rewrite that class in your custom module config.xml and then your class will load first and for core functions it will take core classes

Here is below sample code you can rewrite block classes, The same way you can rewrite helpers and Model classes

If I want to rewrite this block class `Mage_Adminhtml_Block_Sales_Order_Create then I code in my module config.xml Like Below.


And In my class Trimantra_Smallchanges_Block_Adminhtml_Sales_Order_Create

I code Like Below

class Trimantra_Smallchanges_Block_Adminhtml_Sales_Order_Create extends Mage_Adminhtml_Block_Sales_Order_Create {
       //My Function Or funcions That I want to Rewrite..

In blow url I have written a blog you can also check that for more reference


Or you can check blow answer for more detail

How do I override/rewrite a block class in Magento 1?

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.