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

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

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

4条回答
  •  耶瑟儿~
    2021-02-01 05:19

    config.xml:

    
        
             
                
                    Namespace_Module_Block_Adminhtml_Sales_Order_View
                
            
        
     
    

    Namespace/Module/Block/Adminhtml/Sales/Order/View.php:

    class Namespace_Module_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');
        }
    }
    

提交回复
热议问题