Monday 6 April 2015

How to remove decimal values from price?

 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)





No comments:

Post a Comment