Magento themes and extensions

How to hide ‘Add Item’ button in Magento Backend Grid

Posted on July 13th, 2012 | Posted by admin

How to hide ‘Add Item’ button in Magento Backend Grid

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:

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*/
 $this->_removeButton('add'); /*Add this line after calling parent constructor*/

Override Controllers in Magento

Posted on July 13th, 2012 | Posted by admin

While working in Magento you may sometimes run into situations where you would like to override the functionality of the Magento core controllers. But you cannot edit the core controllers of Magento as it will hinder you from upgrading your Magento version. So we have to find a simple solution for that. Don’t worry, today we will see how to override Magento core controllers.
For this, you have to create a custom module. If you do not know how to create a custom module, then read this post.
Now suppose we want to override the checkout/cart controller. To do this, we will have to edit just two files in our custom module.
Suppose our custom module is present in the namespace ‘Company’ and our module is named as ‘Web’.

Step 1:
Open the app\code\local\Company\Web\etc\config.xml and edit it as follows:
The name of the core module to be overridden is written in between the router tags.

Creating Custom Configuration Options in Magento Admin

Posted on July 11th, 2012 | Posted by admin

As a Magento developer you frequently encounter the Configuration page of Magento admin backend. But have you ever noticed how these configuration pages are created and where are those configuration options saved? If not don’t worry, today I will tell you how to create an admin configuration page for you custom module. You might wonder that their is no ‘.phtml’ involved in this configuration page. Shocked! Its ok, we have to play only with the xmls to create this functionality. So now lets start the development.

Open your app\code\local\<Namespace>\<module>\etc\system.xml
If file is not there, create one as stated below.

How to Show Static Block in theme Magento

Posted on July 11th, 2012 | Posted by admin

In magento: Create an Static Block from your CMS admin tab and show it in your theme.

In my case I wanted to call a Static Block from my theme to show up in the sidebar.

I edited my theme file called 2columns-left.phtml and then added the following code.

Please notice you need to replace the YourBlockId with your own Static Block Id.

<?php echo $this->getLayout()->createBlock(‘cms/block’)
->setBlockId(‘YourBlockId’)->toHtml() ?>

Add XX to Cart for Free Shipping – Magento

Posted on July 9th, 2012 | Posted by admin

Create Apple’s style of Add XX to your order and get Free Shipping in magento

Paste the following code where you want to add the code.

I would suggest something like: