Hi,
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.
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 3596 times
image 1 - round1.jpg (84.16 KiB) Viewed 3596 times
Actually, 25% of 0,90 is 0,225, which totals 1,125. I'm not sure what you think to be the solution, to round the value down instead of up?
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
That 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
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
possibly here:
https://www.opencart.com/index.php?rout ... arch=round
https://www.opencart.com/index.php?rout ... arch=round
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
UPDATED! 2017-10-18 with //CHANGE 3
Hi!
Check out this solution: https://github.com/copona/copona/commit ... t-24944535
In file:
In file:
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
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
Last edited by arnisraido on Wed Oct 18, 2017 7:43 am, edited 2 times in total.
@arnisraido Hi, I can confirm that your modificaton on tax.php made total price corect, but bottom Total , subtotal and tax is not correct, also Total price on top cart button is not corect. Please see image in attachement
Thank You
Thank You
Attachments
total - round3.jpg (169.76 KiB) Viewed 3496 times
That's great!
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.
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.
Are you clearing cache after doing those modifications?
Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com
Additional rounding added. Please, give it a try: https://github.com/copona/copona/commit ... 2bee9e3d04
Full discussion about this also is going on here: https://github.com/copona/copona/commit ... 4a50637b2b
Full discussion about this also is going on here: https://github.com/copona/copona/commit ... 4a50637b2b
Who is online
Users browsing this forum: Semrush [Bot] and 100 guests