Magento themes and extensions

Override Controllers in Magento

Share
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

Share
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

Share
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

Share
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:

I can’t add a product to my wishlist – Magento

Share
Posted on July 9th, 2012 | Posted by admin

I can’t add a product to my wishlist – Magento

One of our clients at the office had a store and the “wishlist” button in the product view wasn’t working.

The products he was trying to add weren’t in the root category.

You must add your products at least to the root category.