Magento CE

I would like to rewrite Mage_Adminhtml_Block_Catalog_Product_Edit.

Specifically this file: app/code/Mage/Adminhtml/Block/Catalog/Product/Edit.php

In my custom module's etc/config.xml file I have this for the rewrite block (not actually MyCompany/MyModule):


But where this approach has worked before for overwriting other blocks, I'm now getting this PHP error:

PHP Fatal error:  Class 'MyCompany_MyModule_Block_Adminhtml_Catalog_Product_Edit' not found in /var/www/html/app/code/core/Mage/Core/Model/Layout.php on line 491

I think my config.xml rewrite entry might be at fault but I'm not certain.

  • Please check at module main config. MyCompany_MyModule.xml add your system not check compiler is enabled ornot
    – Amit Bera
    Commented May 10, 2016 at 18:35
  • From the error, it looks like your configuration is working fine, and the class file can be found from the system. You probably have some sort of syntax error in your PHP file (maybe a typo in your class name? Or upper/lowercase naming issue?). What happens if you manually require your file?
    – fmrng
    Commented May 10, 2016 at 21:49

1 Answer 1


Check below code, may be this will help you out.
Config.xml for rewrite

<?xml version="1.0"?>

Code for extending class

class My_Custom_Block_Adminhtml_Catalog_Product_Edit extends Mage_Adminhtml_Block_Catalog_Product_Edit {


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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