开发者

Overriding Magento Admin Controller, for Beginners

开发者 https://www.devze.com 2022-12-31 02:39 出处:网络
In the Magento Admin section, I want to override the \"Sales/Order/ShipmentController.php\" controller file of the core Mage.

In the Magento Admin section, I want to override the "Sales/Order/ShipmentController.php" controller file of the core Mage.

I have tried rewriting the URL, using the "from" & "to" tags, but in vain.

I don't know what is the actual & correct w开发者_运维百科ay of doing this, as I'm a newbie in Magento.

Please anybody provide some good fundamental & correct answer, so that at least the concept gets clear.

Also, if possible, please tell me, what is the actual purpose of the controller, for both the frontend & the back-end?

Any help is greatly appreciated.


The correct method for overriding a controller is specified here : http://www.magentocommerce.com/boards/viewthread/16224/

The method of copying files from the core to local is not good. Doing so in this way means that you can only be sure that your custom module will work with the version of Magento that YOU are using. If you want the best chance of your module being compatible with other versions, it needs to be loosely coupled - extending and overriding the functions necessary for your purposes


Not sure what you are talking about with "from" and "to" tags... What you need to do is write a simple custom module (the best way), or just override the controller by putting it in the /app/code/local/ directory.

[Edit] - I wrote a post that covers overriding the different Magento elements, controllers included: http://prattski.com/2010/06/24/magento-overriding-core-files-blocks-models-resources-controllers/

I hope that helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消