Magento Coding Solutions

Make custom url in Magento Modul in Admin


<?php
My actual Url is
"http://localhost/magento/index.php/admin_metal/adminhtml_metalbackend/index/key/f64c498b4c19e35795ce97188cd3c3ee/";

we create Url by Pragmatically :
echo Mage::helper("adminhtml")->getUrl("metal/adminhtml_metalbackend");

?>

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

Example: "Jewelry" is my  Namespace and  "Basicprice" is my Module

Rename ‘Add New’ Button:

Step 1 : Go to app\code\local\Jewelry\Basicprice\Block\Adminhtml\Basicprice.php

There is a code 
public function __construct()
{

$this->_controller = "adminhtml_basicprice";
$this->_blockGroup = "basicprice";
$this->_headerText = Mage::helper("basicprice")->__("Basicprice Manager");
$this->_addButtonLabel = Mage::helper("basicprice")->__("Add New Item");
parent::__construct();


}


Step 2 : replace  $this->_addButtonLabel = Mage::helper("basicprice")->__("Add New Item");  to $this->_addButtonLabel = Mage::helper("basicprice")->__("Your Custom Name");


Here are the steps to remove the “Add New” button

Step 1 :  Go to app\code\local\Jewelry\Basicprice\Block\Adminhtml\Basicprice.php
and add  this code "$this->_removeButton('add'); " in below parent::__construct(); function

Example:
public function __construct()
{

$this->_controller = "adminhtml_basicprice";
$this->_blockGroup = "basicprice";
$this->_headerText = Mage::helper("basicprice")->__("Basicprice Manager");
$this->_addButtonLabel = Mage::helper("basicprice")->__("Add New Item");
parent::__construct();
$this->_removeButton('add');

}