Page 1 of 1

Simple math?

Posted: Sun Jun 21, 2015 6:53 pm
by raybark
Can someone please explain why there is such a basic math error at checkout, and how to fix it?

Image

Re: Simple math?

Posted: Sun Jun 21, 2015 7:09 pm
by chulcha
8,143 ~ 8.14
+
2,263 ~ 2.26
=
10,406 ~ 10.41

Re: Simple math?

Posted: Mon Jun 22, 2015 9:35 am
by raybark
OK, that explains it - how to limit it to two decimal digits?

Re: Simple math?

Posted: Mon Jun 22, 2015 1:17 pm
by deepvision
System -> Localisation -> Currencies -> USD -> Decimal places

Re: Simple math?

Posted: Mon Jun 22, 2015 4:41 pm
by chulcha
may by

try it

First! Backup catalog/controller/checkout/cart.php
Second! Backup catalog/controller/checkout/cart.php

catalog/controller/checkout/cart.php

find code

Code: Select all

					foreach ($total_data as $key => $value) {
						$sort_order[$key] = $value['sort_order'];
					}
insert into body of circle

Code: Select all

$total_data[$key] = round($value['value'],2); 
final code

Code: Select all

					foreach ($total_data as $key => $value) {
$total_data[$key] = round($value['value'],2); 
						$sort_order[$key] = $value['sort_order'];
					}



Re: Simple math?

Posted: Tue Jun 23, 2015 12:07 am
by raybark
deepvision wrote:System -> Localisation -> Currencies -> USD -> Decimal places
Thanks, but that was already set to two decimal places.

Re: Simple math?

Posted: Tue Jun 23, 2015 12:15 am
by raybark
chulcha wrote:may by

try it

First! Backup catalog/controller/checkout/cart.php
Second! Backup catalog/controller/checkout/cart.php

catalog/controller/checkout/cart.php

find code

Code: Select all

					foreach ($total_data as $key => $value) {
						$sort_order[$key] = $value['sort_order'];
					}
insert into body of circle

Code: Select all

$total_data[$key] = round($value['value'],2); 
final code

Code: Select all

					foreach ($total_data as $key => $value) {
$total_data[$key] = round($value['value'],2); 
						$sort_order[$key] = $value['sort_order'];
					}


Thanks. I have given that a try, so we'll see...