Displaying Currency code after the price value in Magento

Posted on August 21st, 2012 | Posted by admin

I had a time to research on Magento’s currency format and its display on Magento webshop. I then came across a block where I could change the format of currency display, in this case I am talking about moving the currency symbol to the right of the price value. In other words I found a way to show $10.00 as 10.00$. Notice the $ (Dollar) sign moving at the right of the price value.
Here’s a description of how this can be achievable. The basic idea is to rewrite Mage_Core_Model_Locale class’s currency function and add additional code. First you must write a rewrite code in your module’s config.xml.


Adding CSS Class name to my account link in magento through XML Layout

Posted on August 17th, 2012 | Posted by admin

Adding CSS Class name to my account link in magento through XML Layout

At the first instance I thought WTH! must be pretty simple, add params in XML layout . But later I found that it was not simpler as I thought. I had to get into the addLink method for sometime and finally I came up with correct structure of XML layout. At the end it again seemed simple though, but it needed a healthy effort.

Here’s the XML structure of layout from customer.xml where you add class to  my account link.

<!-- customer.xml-->
<reference name="top.links">
<action method="addLink" translate="label title" module="customer">
<label>My Account</label>
<url helper="customer/getAccountUrl"/>
<title>My Account</title>

Override Controllers in Magento

Posted on February 22nd, 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’.

Page 3 of 3«123