Magento OnepageController覆盖破解结账

时间:2013-06-13 06:14:21

标签: magento

简而言之:覆盖一页购物车控制器并点击前端的“结帐”不再重定向到结帐/ onepage /

细节:我正在尝试覆盖OnepageController的一些功能 - 基本上它总是从计费标签转到发货标签,我可以要求一些额外的运费相关用于计算的信息,以及运费。

所以,这是config.xml位:

<frontend>
    <routers>
        <checkout>
            <args>
                <modules>
                    <CodexMedia_SmartSend before="Mage_Checkout">
                    CodexMedia_SmartSend
                    </CodexMedia_SmartSend>
                </modules>
            </args>
        </checkout>
    </routers>
</frontend>

..它使用一个新的OnepageController实例(位于CodexMedia / SmartSend / controllers / OnepageController.php中),扩展了Mage_Checkout_OnepageController)这个控制器只有saveBillingAction()模式,总是推出运输选项卡,而不是直接付款信息(我将在正常工作时添加自定义saveShippingAction逻辑)。

我最好的猜测是我已经尝试了某种路由

感谢您的帮助!

编辑:将控制器移至控制器/ Checkout,将类更改为CodexMedia_SmartSend_Checkout_Onepagecontroller并将配置更改为:

        <checkout>
            <args>
                <modules>
                    <CodexMedia_SmartSend_Checkout before="Mage_Checkout">CodexMedia_SmartSend_Checkout</CodexMedia_SmartSend_Checkout>
                </modules>
            </args>
        </checkout>

宾果!都好。谢谢你的帮助!

1 个答案:

答案 0 :(得分:2)

您需要删除CodexMedia_SmartSend标记之间的换行符。配置文件应如下所示

<frontend>
    <routers>
        <checkout>
            <args>
                <modules>
                    <CodexMedia_SmartSend before="Mage_Checkout">CodexMedia_SmartSend</CodexMedia_SmartSend>
                </modules>
            </args>
        </checkout>
    </routers>
</frontend>