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

Viewed 30818

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

4 Answers

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();

    }
}
Related