我正在为magento创建一个自定义模块,以便在admin html订单列表中添加“同步”按钮。我开始创建模块,我将向您展示我的文件,我刚刚开始创建模块。
问题:该按钮未显示在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>
app / Module_Parcel.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Module_Parcel>
<active>true</active>
<codePool>local</codePool>
</Module_Parcel>
</modules>
</config>
_addButton
接受5个参数,则传递6个。
$this->_addButton('button_id', array(
'label' => Mage::helper('adminhtml')->__('Some action'),
'onclick' => 'jsfunction(this.id)',
'class' => 'go'
), 0, 100, 'header');
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句