Magento – Remove Mass action from Sales/Order Grid

deleteextensionsmassactionsalessales-order

I need to remove a few options from the Admin/Sales/Order Actions list. I do not want to edit the core files in Magento

Right now when I click on the drop down list Actions in the top right corner of the page, it shows Print Invoices among other things. I want to remove that option in my code without editing anything in the core files.

I know currently if I delete the following line of code from Core file Mage/Adminhtml/Block/Sales/Order/Grid.php the option will not be displayed.

$this->getMassactionBlock()->addItem('pdfinvoices_order', array(
         'label'=> Mage::helper('sales')->__('Print Invoices'),
         'url'  => $this->getUrl('*/sales_order/pdfinvoices'),
    ));

Is there any other way to do this?

Best Answer

Check whether the massaction block has a name, if this is the case you can add <remove name="nameOfBlock"> to a local.xml you add to the adminhtml theme.

If the block is anonymous, which I guess, you can implement an observer listening on the event core_block_abstract_to_html_before, check for the instance of the block, make sure you handle the right block and then setTemplate(''). Due to the check in _toHtml() this returns nothing

Related Topic