How to create sales order custom tab in magento 1.8.0.1

别来无恙 提交于 2019-12-24 12:30:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!