How can I override a Magento controller?

后端 未结 1 1348
我寻月下人不归
我寻月下人不归 2021-01-18 09:06

I need to check the validity of a coupon code on the checkout/cart page with server-side code.

Magento already ships with a similar check in place. However, I need t

相关标签:
1条回答
  • 2021-01-18 09:40

    Anything besides modifying the core is good in my opinion. With that said create a simple module with a controllers directory and etc with config.xml:

    <config>
        <frontend>
            <routers>
                <checkout>
                    <args>
                        <modules>
                             <My_Module before="Mage_Checkout">My_Module_Checkout</My_Module>
                        </modules>
                    </args>
                </checkout>
            </routers>
        </frontend>
    </config>
    

    See here for more details on how to extend the frontend controller: http://prattski.com/2010/06/24/magento-overriding-core-files-blocks-models-resources-controllers/

    0 讨论(0)
提交回复
热议问题