似乎无法覆盖Magento中的Checkout控制器 [英] Can't seem to override Checkout Controller in Magento

查看:55
本文介绍了似乎无法覆盖Magento中的Checkout控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试对Magento商店中的Checkout控制器进行一些更改,但是,当我尝试将控制器文件放到本地目录中时,似乎并没有尊重本地文件.

I am trying to make some changes to the Checkout controller in my Magento store, however, when I try to put the controller file into my local directory it does not seem to be respecting the local file for this.

我已经检查了文件在各自的代码池中是否位于同一位置,并且文件被命名为相同的东西,只是不会这样做.

I have checked that the files are in the same spot in their respective code pools and the files are named the same thing, it just will not do it.

  • /app/code/core/Mage/Checkout/controllers|CartController.php
  • /app/code/local/Mage/Checkout/controllers|CartController.php

这些是我拥有的两个文件的文件路径.

Those are the file paths for the two files I have.

Magento中的签出文件是否有特殊之处,可以防止它们被覆盖?

Is there something special about the checkout files in Magento that prevent them from being overridden?

推荐答案

仅供参考,仅通过将相关文件放置在具有相同文件夹结构的本地文件夹中,控制器覆盖无法正常工作.相反,您需要遵循以下语法:

FYI, controller overriding doesn't work just by placing the related file in local folder with the same folder structure. Rather you need to follow the following syntax for the purpose:

<config>
    <frontend> [1]
        <routers>
            <checkout> [2]
                <args>
                    <modules>
                        <yourModule before="Mage_Checkout">Namespace_Module_Overwrite_Checkout</yourModule> [3]
                    </modules>
                </args>
            </checkout>
        </routers>
    </frontend>
</config>


[1] Depending on the controllers area ,"frontend" or "admin"
[2] Router node of the module to be overridden (look it up in the config.xml of that module)
[3] The tag  can be anything, it must be unique within the  node.
Your_Module_Overwrite_Checkout (is mapped to directory)
Your/Module/controllers/Overwrite/Checkout/

Hope this helps.
Regards
MagePsycho

这篇关于似乎无法覆盖Magento中的Checkout控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆