How to add new button to order view in Magento admin panel?

后端 未结 4 2006
情书的邮戳
情书的邮戳 2021-02-01 05:02

How to add custom button to order view page near \"Back\" and \"Edit\"?

4条回答
  •  感动是毒
    2021-02-01 05:26

    In reference to the comments above about the parent::__constructor, here is what worked for me:

    class Name_Module_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View {
    
        public function  __construct() {
            $this->_addButton('testbutton', array(
                'label'     => Mage::helper('Sales')->__('Toms Button'),
                'onclick'   => 'jsfunction(this.id)',
                'class'     => 'go'
            ), 0, 100, 'header', 'header');
    
            parent::__construct();
    
        }
    }
    

提交回复
热议问题