Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • This will not work. Block rewriting does not apply to parent classes. Commented Jan 22, 2013 at 13:40
  • Yes, the solution suggested by fab is better. But this example will work because you directly rewrite Mage_Adminhtml_Block_Widget_Grid, call its __construct (in which template will be set the first time) and then set your template. Commented Jan 22, 2013 at 14:09
  • You seem to misunderstand how class rewrites work in Magento. createBlock('group/name') uses the config object, but that will autoload only the rewritten class definition, which then specifies the parent class by name. The autoloader - which is solely responsible when it comes to loading the parent class - does not in any way evaluate class rewrites from configuration XML. Do a simple test with a subclass of Mage_Adminhtml_Block_Widget_Grid and you will see what I mean. Commented Jan 22, 2013 at 14:30
  • yes, I know how it works and it was my mistake. sales order grid needed to be rewriten in this question directly. I changed my answer. Commented Jan 22, 2013 at 14:45
  • @freento Instead of edit core file what is the best alternate like do changes app/design/frontend/default/theme instead of app/design/frontend/default/default Commented Dec 24, 2019 at 10:43