B-219 Sec-55 Noida, India
+918010221733

Remove Or Rename “Add New” Button From Admin Grid In Magento

Suppose you are developing a custom Magento Extension and you don’t want to show or you want to Rename “Add New” button in the Grid. The Add New button is presented in top right corner of Grid Page.
You can Remove/Rename it by following the steps given below:

Rename ‘Add New’ Button:

Here are the steps to rename the “Add New” text to anything you required (for example, “Add Testimonial”):-
Step 1 : Go to YourNamespace -> YourModule -> Block -> Adminhtml -> YourFile.php
Step 2 : Add the following code in the constructor of this file:-
Step 3 : $this->_addButtonLabel = Mage::helper(‘yourmodulename’)->__(‘Add Testimonial’);
You are done.

Remove “Add New” button :
Here are the steps to remove the “Add New” button
Step 1 : Go to YourNamespace -> YourModule -> Block -> Adminhtml -> YourFile.php
Step 2 : Add the following code in the constructor of this file (it should be just below the call to parent constructor):-
Step 3 : parent::__construct();
Step 4 : $this->_removeButton(‘add’);
Step 5 : Refresh the Magento Cache and you will see the changes in your extension.

(Visited 399 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.