问题
I have created sales order custom tab.also it display on admin side but template file does not call.
Here is code for adding tab adminhtml layout file
<?xml version="1.0"?>
<layout>
<adminhtml_sales_order_view>
<reference name="sales_order_tabs">
<action method="addTab">
<name>order_view_tab_salesordertab</name>
<block>salesordertab/adminhtml_order_view_tab_salesordertab</block>
</action>
</reference>
</adminhtml_sales_order_view>
</layout>
Block file
class <module>_Salesordertab_Block_Adminhtml_Order_View_Tab_Salesordertab extends Mage_Adminhtml_Block_Template
implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
protected function _constuct()
{
parent::_construct();
$this->setTemplate('salesordertab/order/view/tab/salesordertab.phtml');
}
public function getTabLabel() {
return $this->__('Operater Detail');
}
public function getTabTitle() {
return $this->__('Operater Detail');
}
public function canShowTab() {
return true;
}
public function isHidden() {
return false;
}
public function getOrder(){
return Mage::registry('current_order');
}
}
any help would be much appreciated.Thanks
回答1:
There is a little mistake in code.
protected function _construct() /* here construct spell mistake */
{
parent::_construct();
$this->setTemplate('salesordertab/order/view/tab/salesordertab.phtml');
}
来源:https://stackoverflow.com/questions/20835199/how-to-create-sales-order-custom-tab-in-magento-1-8-0-1