我在我的 magento 1.7 商店上安装了扩展 CreativeStyle CheckoutByAmazon,我试图覆盖 CheckoutController 类,但 magento 似乎忽略了我的覆盖。任何建议将不胜感激。也清除了缓存但仍然不起作用
(在 app/code/local 文件夹中)
MyModule \CheckoutByAmazon \controllers \CheckoutController.php \etc \config.xml
(应用程序/etc/config.xml)
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<MyModule_CheckoutByAmazon>
<version>0.1.0</version>
</MyModule_CheckoutByAmazon>
</modules>
<frontend>
<routers>
<checkoutbyamazon>
<args>
<modules>
<MyModule_CheckoutByAmazon before="Creativestyle_CheckoutByAmazon">MyModule_CheckoutByAmazon</MyModule_CheckoutByAmazon>
</modules>
</args>
</checkoutbyamazon>
</routers>
</frontend>
</config>
(在 app/code/local/MyModule/CheckoutByAmazon/controllers/CheckoutController 中)
<?php
//Controllers are not autoloaded so we will have to do it manually:
require_once 'Creativestyle/CheckoutByAmazon/controllers/CheckoutController.php';
class MyModule_CheckoutByAmazon_CheckoutController extends Creativestyle_CheckoutByAmazon_CheckoutController {
public function indexAction() {
exit('I am here');
parent::indexAction();
}
//i want to override this function
public function saveShippingAction() {
//insert my overriding code
exit('saveShipping');
}
}
?>
(在 etc/modules/MyModule_CheckoutByAmazon.xml 中)
<?xml version="1.0"?>
<config>
<modules>
<MyModule_CheckoutByAmazon>
<active>true</active>
<codePool>local</codePool>
</MyModule_CheckoutByAmazon>
</modules>
</config>
我哪里错了?