I got product with price without tax 0,90
my tax is 25% so it show 1,13 with tax on product page (image 1)
If I set 100 pieces in cart, on cart page Total with tax is 112,50 !!! (image 2) (It should be 1,13*100=113,00)
http://www.opencart-web.xyz/3020/index. ... duct_id=47
This is default opencart without any extenzions!
I supposed problem is in rounded numbers or something like this, how can I fix this problem ? My opencart version is 3020 but it is same on opencart 20x.
Attachments
image 2 - round2.jpg (163.2 KiB) Viewed 2736 times
image 1 - round1.jpg (84.16 KiB) Viewed 2736 times
Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com
As you see something is not wright, because price 1,13*100 pieces is 113,00 in total But in cart show total 112,50 ? and customer is confused
On product page 0,225 is rounded to 0,23 so 0,90+0,23= 1,13
but on cart page is problem because 25% of 90 is 22,50 so system havent got nothing to round
Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com
Hm dont know what i get with such solution, and what to change in code or settings to get this ? Thanksyodapt wrote: ↑Thu Oct 12, 2017 5:08 amThat is just how it is. The values are round to the second decimal, not the first, so 1,55 doesnt become 1,60, but 1,555 becomes 1,56. The best you can do, if you dont want your customers confused over a cent, is to round down the total, so that 1,555 becomes 1,55 instead of 1,56
https://www.opencart.com/index.php?rout ... arch=round
Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'800+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.
Hi!
Check out this solution: https://github.com/copona/copona/commit ... t-24944535
In file:
Code: Select all
system\library\cart\tax.php
Code: Select all
// CHANGE 1:
// find line (~line 74):
return $value + $amount;
// replace with
return round($value + $amount, 2);
// CHANGE 2:
// find line (~line 122)
'amount' => $amount
// replace with:
'amount' => round($amount, 2)
Code: Select all
system/library/cart/cart.php
Code: Select all
// CHANGE 3:
// find lines (~line 275)
'price' => ($price + $option_price),
'total' => ($price + $option_price) * $cart['quantity'],
// replace with:
'price' => round($price + $option_price, 2),
'total' => round($price + $option_price, 2) * $cart['quantity'],
P.S. It has been already discussed here (without a solution). Hope we can fix this together.
Here https://github.com/opencart/opencart/issues/5657
And even here ... https://www.opencart.com/forum/viewtopi ... 19&t=50997
And probably, this one too: https://github.com/opencart/opencart/issues/1990
Thank You
Attachments
total - round3.jpg (169.76 KiB) Viewed 2636 times
Ok, I think, in Copona we use little bit different calculations and my cart was calculating correctly, but I will check.
For Opencart - I have updated the answer with // CHANGE 2:, so - try that one together with previous fix.
Post a feedback.
Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com
Full discussion about this also is going on here: https://github.com/copona/copona/commit ... 4a50637b2b
Users browsing this forum: No registered users and 29 guests