10/16/2011

How to remove decimal price in magento

Hello Everyone,

                 Today I’m going to tell you how to remove decimal price in magento.In simple words, This tutorial will tell to change the price from Rs. 121.00 to Rs . 121 for example.
                For this, you need to edit code/core/Mage/Directory/Model/Currency.php


  • Open  code/core/Mage/Directory/Model/Currency.php
  •  Find the following :-
 public function format($price$options=array(), $includeContainer = true, $addBrackets = false)
    {
        return $this->formatPrecision($price, 2, $options$includeContainer, $addBrackets);
    }

on line no 194
change this code to:-

 public function format($price$options=array(), $includeContainer = true, $addBrackets = false)
    {
        return $this->formatPrecision($price, 0, $options$includeContainer, $addBrackets);
    }

0 - Denotes the precision point for price..

But wait, you are still not done. The most important thing is still left.
- Clear the Cache.
- Go to System –> Cache Management
- Refreh Cache.
- If you have not enabled the Cache OR if it didn’t work even after refreshing the cache, then
- delete the cache folder present inside var (var/cache)

You can also refer to the video showing how it actually works




Start your Ecommerce website at just Rs .10000

Contact : Renderindia Infotech Bangalore
Bangalore Branch Office

110 , 5th cross, ITPL main road , Kundanhalli Colony
 Bangalore :-  560037.
 Mobile no :- 91-8123481528 (Ashish Khadpe)
 Mobile no :- 91-9769941316 (Rehan Sheikh)


No comments:

Post a Comment