2

I am building an ecommerce website named bookslab.in.

I want to remove the .00 decimals from the all products prices that i am adding in the shopping cart & in Invoice generated.

I am using the ET currency manager, it removes the prices decimals of all the products except the shopping cat products & Invoice

Is there any way to remove the decimals from the shopping cart products & from Invoices & to convert the main price without decimals. I want my grand total without the decimals.

My store currency in **Indian Rupees.

I am attaching the screenshot. Do i require any changes.

enter image description here

  • Have you tried to this solution ? – Hardik Visa Dec 31 '16 at 10:00
  • I had don the changes in currency.phtml, but it does work? – Salman Dalal Dec 31 '16 at 10:53
  • I have installed magento 1.9.3.8 and the next route does not appear and I can not delete the decimals either 4)\app\code\local\Mage\Sales\Model\Order.php line 1358: public function formatPrice($price, $addBrackets = false) { return $this->formatPricePrecision($price, 0, $addBrackets); } thanks! – fanny campos Jun 4 '18 at 21:21
2

In order to change price precision in magento you would need to overwrite some core files.

In the example below we are changing precision to 0.

1) Overwrite lib/Zend/Currency.php and change precision around line:

 protected $_options = array(
     'position'  => self::STANDARD,
     'script'    => null,
     'format'    => null,
     'display'   => self::NO_SYMBOL,
     'precision' => 0,    /*CHANGE*/
     'name'      => null,
     'currency'  => null,
     'symbol'    => null,
     'locale'    => null,
     'value'     => 0,
     'service'   => null,
     'tag'       => 'Zend_Locale'
 );

2) overwrite app/code/core/Mage/Core/Model/Store.php and change roundPrice function:

public function roundPrice($price)
{    
    return round($price, 0);
}

3) overwrite app/code/core/Mage/Directory/Model/Currency.php and change format function:

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

4)\app\code\local\Mage\Sales\Model\Order.php line 1358:

public function formatPrice($price, $addBrackets = false)
{
    return $this->formatPricePrecision($price, 0, $addBrackets);
}
  • Okzz i will check & get back to you – Salman Dalal Jan 1 '17 at 8:02
  • I had made the changes in all 3 files as you instructed, but still .00 comes in shopping cart & invoice of order – Salman Dalal Jan 1 '17 at 8:11
  • clear cache @SalmanDalal – Gopal Patel Jan 1 '17 at 8:12
  • i had clear but results are the same no changes – Salman Dalal Jan 1 '17 at 8:13
  • Its working at my side @SalmanDalal – Gopal Patel Jan 1 '17 at 8:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.