Tuesday 25 June 2013

Magento - How to add button to order view page in admin


 - How could we add button to the top of order view page in admin?   (behind back, edit, cancel, hold, invoice, ship).



 We will either have to override the mage block or edit the core.  But to add you can do something like this:
app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php
Mage_Adminhtml_Block_Sales_Order_View
Add the following to the constructor:

 $this->_addButton('order_reorder', array(
            
            'label'     => Mage::helper('sales')->__('Print'),
            
            'onclick'   => 'setLocation(\'' . $this->getUrl('ssireports/index/invoice') . '\')',
        ));
        ));

No comments:

Post a Comment