我试图扩展我的Magento Catalog ProductController视图 (确切地说是Mage_Checkout_CartController :: ViewAction)和Magento似乎没有确认模块扩展。
所以我有以下文件:
这是/app/code/local/Mage/SwapMachine/etc/config.xml配置文件
ngReadonly
这是/app/design/frontend/base/default/layout/swapmachine.xml文件。正如我被指示从源#2创建(源于底部)
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Mage_SwapMachine>
<version>0.1.0</version>
</Mage_SwapMachine>
</modules>
<frontend>
<routers>
<swapmachine>
<args>
<modules>
<Mage_SwapMachine before="Mage_Catalog">Mage_SwapMachine_Frontend</Mage_SwapMachine>
</modules>
</args>
</swapmachine>
</routers>
</frontend>
</config>
这是/app/code/local/Mage/SwapMachine/controllers/Frontend/ProductController.php文件
<?xml version="1.0"?>
<mage_swapmachine_frontend>
<update handle="catalog_product_view"/>
</mage_swapmachine_frontend>
我已经试着自己解决这个问题一段时间了,我感到迷茫。我首先按照这里的信息。
Magento Catalog ProductController rewrite
经过多次尝试后,我后来发现了这个并尝试了这里的信息,虽然它是针对Magento 2的。
https://magento2.atlassian.net/wiki/display/m1wiki/How+To+Overload+a+Controller
答案 0 :(得分:0)
当您尝试覆盖目录模块时,XML应如下所示:
<frontend>
<routers>
<catalog>