0
我想覆蓋管理銷售/訂單/發票控制器。我嘗試了一切,但它不覆蓋。下面是代碼:如何覆蓋管理員發票控制器
配置文件:
<?xml version="1.0" encoding="utf-8"?>
<config>
<admin>
<routers>
<adminhtml>
<use>admin</use>
<args>
<modules><TW_Printinvoice before="Mage_Adminhtml">TW_Printinvoice_Adminhtml</TW_Printinvoice>
</modules>
</args>
</adminhtml>
</routers>
</admin>
控制器的文件與路徑:app/code/local/TW/Printinvoice/controllers/Adminhtml/Sales/Order/
require_once 'Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php';
class TW_Printinvoice_Adminhtml_Sales_Order_PrintController extends Mage_Adminhtml_Sales_Order_InvoiceController
{
public function printAction()
{
die('Testing');
}
}
感謝這爲我工作..但不知道爲什麼文件名稱使差異.. – ssnegi