How to hide 'Add Item' button in Magento Backend Grid

7 comments
In some cases you might need to hide the 'Add Item' button on the grid page in backend module for admin. This may eat your head if you have no idea of what is going on. But this is as simple as nothing. Follow the below given steps and you are done in less than a minute.

Open app\code\local\<namespace>\<module>\Block\Adminhtml\<module>.php and perform following changes:

<?php
class <Namespace>_<Module>_Block_Adminhtml_<Module> extends Mage_Adminhtml_Block_Widget_Grid_Container
{
  public function __construct()
  {
    $this->_controller = 'adminhtml_<module>';
    $this->_blockGroup = '<module>';
    $this->_headerText = Mage::helper('<module>')->__('My Custom Module');
    // $this->_addButtonLabel = Mage::helper('<module>')->__('Add Item'); /*Comment out this line*/
    parent::__construct();
 $this->_removeButton('add'); /*Add this line after calling parent constructor*/
  }
}
And you are done!

7 comments

Thanks for your instructions!

Do you know if is possible to hide the button to specific products which fulfill an atribute?

Or to a specific category but not to the whole store?

Thanks.

thnx a lot

HI

I Want to hide "Reset filter" ?

This is very wonderful so nice and beautiful information thanks for this post.

Thanks for sharing these useful information! Hope that you will continue doing nice article like this.

Very interesting topic and useful post. It really help me. THANK YOU!!!

We would love to hear from you...

back to top