Skip to main content
deleted 52 characters in body
Source Link
Rajeev K Tomy
  • 17.3k
  • 6
  • 63
  • 103

Ya I was waiting for marius to answer this question. He did it as I expected. I need to mention one more thing along with his answer. You need to call that "bad controller" just above your controller definition. That is

File :Vendor/AdvancedStock/controllers/Adminhtml/YourcontrollernameControllerProductController.php

<?php    
require_once(Mage::getModuleDir('controllers','MDN_AdvancedStock').DS.'ProductController.php');
class Vendor_AdvancedStock_Adminhtml_YourcontrollernameControllerVendor_AdvancedStock_ProductController extends MDN_AdvancedStock_Adminhtml_ProductControllerControllerMDN_AdvancedStock_ProductController
{
     // some code
}

I told so because, as per my knowledge magento will not include the class that you are going to rewrite, if that class stands for a controller. For block rewrite, helper rewrite you may not require this step. Since magento will do that job for us.

Ya I was waiting for marius to answer this question. He did it as I expected. I need to mention one more thing along with his answer. You need to call that "bad controller" just above your controller definition. That is

File :Vendor/AdvancedStock/controllers/Adminhtml/YourcontrollernameController.php

<?php    
require_once(Mage::getModuleDir('controllers','MDN_AdvancedStock').DS.'ProductController.php');
class Vendor_AdvancedStock_Adminhtml_YourcontrollernameController extends MDN_AdvancedStock_Adminhtml_ProductControllerController
{
     // some code
}

I told so because, as per my knowledge magento will not include the class that you are going to rewrite, if that class stands for a controller. For block rewrite, helper rewrite you may not require this step. Since magento will do that job for us.

Ya I was waiting for marius to answer this question. He did it as I expected. I need to mention one more thing along with his answer. You need to call that "bad controller" just above your controller definition. That is

File :Vendor/AdvancedStock/controllers/ProductController.php

<?php    
require_once(Mage::getModuleDir('controllers','MDN_AdvancedStock').DS.'ProductController.php');
class Vendor_AdvancedStock_ProductController extends MDN_AdvancedStock_ProductController
{
     // some code
}

I told so because, as per my knowledge magento will not include the class that you are going to rewrite, if that class stands for a controller. For block rewrite, helper rewrite you may not require this step. Since magento will do that job for us.

Source Link
Rajeev K Tomy
  • 17.3k
  • 6
  • 63
  • 103

Ya I was waiting for marius to answer this question. He did it as I expected. I need to mention one more thing along with his answer. You need to call that "bad controller" just above your controller definition. That is

File :Vendor/AdvancedStock/controllers/Adminhtml/YourcontrollernameController.php

<?php    
require_once(Mage::getModuleDir('controllers','MDN_AdvancedStock').DS.'ProductController.php');
class Vendor_AdvancedStock_Adminhtml_YourcontrollernameController extends MDN_AdvancedStock_Adminhtml_ProductControllerController
{
     // some code
}

I told so because, as per my knowledge magento will not include the class that you are going to rewrite, if that class stands for a controller. For block rewrite, helper rewrite you may not require this step. Since magento will do that job for us.