我正在爲magento創建自定義模塊,以在admin html順序列表中添加「同步」按鈕。我開始創建我的模塊,我將向您展示我的文件,我剛開始創建模塊。無法將自定義按鈕添加到Magento中的adminhtml
問題:該按鈕沒有示出在任何地方adminhtml向上
應用程序/代碼/本地/模塊/包裹/砌塊/ Adminhtml /銷售/訂購/ View.php
<?php
class Module_Parcel_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View
{
public function __construct() {
parent::__construct();
$this->_addButton('button_id', array(
'label' => Mage::helper('xxx')->__('Some action'),
'onclick' => 'jsfunction(this.id)',
'class' => 'go'
), 0, 100, 'header', 'header');
}
}
?>
應用程序/代碼/本地/模塊/包裹的/ etc/config.xml中
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Module_Parcel>
<version>0.0.1</version>
</Module_Parcel>
</modules>
<global>
<blocks>
<adminhtml>
<rewrite>
<sales_order_view>Module_Parcel_Block_Adminhtml_Sales_Order_View</sales_order_view>
</rewrite>
</adminhtml>
</blocks>
</global>
</config>
應用程序/ Module_Parcel.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Module_Parcel>
<active>true</active>
<codePool>local</codePool>
</Module_Parcel>
</modules>
</config>
編輯,非常感謝您的幫助!編輯 – SinisterGlitch