Magento: Admin Controller Override
Consideration: MyNameSpace = PG and MyModule = Deletecc
Note:1:We are taking example of OrderController.php of \app\code\core\Mage\Adminhtml\controllers \Sales.
2:This Module is applicable for Magento-1.4.0.x
Create Your own module and files as follows:
Magento/app/code/local/PG/Deletecc/etc/config.xml
Magento/app/code/local/PG/Deletecc/controllers/Sales/OrderController.php
Magento/app/etc/modules/PG_Deletecc.xml
Now Edit config.xml :
Go to Magento/app/code/local/PG/Deletecc/etc/config.xml and paste the following xml code into it
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMXxDMD8gjgTzngDe6LNo5Y5NOWnlaqT8Gq6QCuBW0oCmlxNIM9oV8gDHZb8GS8ZwsigDLVM87m1y6Ca1qAHJLO-Z_OkzYl0PXGtdvr8zZbzr02DdMF8xUSerAiWAPb4fX3eRuMGqzNCwA/s320/admin-reviews-html-php.JPG)
Edit /controllers/Sales/OrderController.php:
Paste the following php code into Magento/app/code/local/PG/Deletecc/controllers/Sales/OrderController.php (the only change we’re doing to the indexAction() is adding an error_log() message):
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyx_TZw-bvHtoRemwP7xK4TqHu4swZ91zNV4Ji2EjLO5Bm3Pl0kUsfCf1Iio39VCklUGxG-xcieV39Prfc9f3JIzR6btKXx4mT1szmaItnb3-ezPR1EIQrFnctZu63xOiRb3UDGIAwrTNv/s320/admin-reviews-html-php.JPG)
Edit Magento/app/etc/modules/PG_Deletecc.xml
Add the below code to enable the your module.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivLMRvksEFkEPjUKuMHGYlxoTwLwQZX8DeD1gZrd7H05jKFDXkvjrJf52XVPDBU8YdcN97WFG056rXUSGB6iuFaG1MAwQCs8ZX0iukqvz-d1wlHYqgCYwNNGs5UWOm3O7T_O8ROs_PL-2L/s320/admin-reviews-html-php.JPG)
That's It..
Note:1:We are taking example of OrderController.php of \app\code\core\Mage\Adminhtml\controllers \Sales.
2:This Module is applicable for Magento-1.4.0.x
Create Your own module and files as follows:
Magento/app/code/local/PG/Deletecc/etc/config.xml
Magento/app/code/local/PG/Deletecc/controllers/Sales/OrderController.php
Magento/app/etc/modules/PG_Deletecc.xml
Now Edit config.xml :
Go to Magento/app/code/local/PG/Deletecc/etc/config.xml and paste the following xml code into it
Edit /controllers/Sales/OrderController.php:
Paste the following php code into Magento/app/code/local/PG/Deletecc/controllers/Sales/OrderController.php (the only change we’re doing to the indexAction() is adding an error_log() message):
Edit Magento/app/etc/modules/PG_Deletecc.xml
Add the below code to enable the your module.
That's It..
Magento: Admin Controller Override
Reviewed by Web Technology Funda
on
5:51:00 AM
Rating:
Your page is so fantastic!The code which you presented in blog its not getting..I will try to hang for next post.i must appreciate your efforts on posting these information..Magento Themes
ReplyDelete