New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$total is not correct #9413
Comments
@BroCart this is not correct, in this case, the admin gets the 2 UAH extra which is not feasible. So, I am closing this issue. |
4.x version is have this bug too: |
@BroCart Please let me know for my above comment |
In the previous option, the admin will benefit. |
Mathematically this is correct. so, closing this issue. |
Please do not close the question and listen to my arguments. |
round(sum(totals)) ≠ sum(round(total)) |
not quite so, for example: |
As per the Default, OpenCart working 536 € will be displayed. As single unit price is 53.55. I need @danielkerr confirmation to make the changes as per your request. |
This issue has been mentioned many times before both here (see #5657, #1990 and #779 for just some of the examples) on the forums. It is obviously going to be very noticeable if converting to a high value currency without decimals. To fix it you would have to do all the checkout total and tax calculations after the currency conversion and rounding. This gets rather complicated when you throw in tax calculation and displaying with and without taxes. |
@danielkerr in my opinion the parameter $quantity should be added to public function format( as a property of an object
p.s. pandorra's box: system/library/cart/cart.php |
@danielkerr As I checked you closed the old issues for the same so we need your confirmation for the same so that we can solve and close this ASAP. |
Has the rounding issue been resolved? But did the problem just end here? |
>2.x
Not correct TOTAL in cart and checkout
one of places where bug is: https://github.com/opencart/opencart/blob/master/upload/catalog/controller/checkout/cart.php#L114
To Reproduce
Steps to reproduce the behavior:
logic of total = round(((unit_price * quantity) * conversion_rate), decimal_place)
Expected behavior
(5[price of unit] * 28.55[conversion rate]) tnen rounded, by decimal place AND then * quantity
correct logic of total = round((unit_price * conversion_rate), decimal_place) * quantity
Screenshots / Screen recordings
http://joxi.ru/EA40JKptp67wqA.png
Additional context
correct logic into controller cart:
$price_temp = $this->currency->format($unit_price, $this->session->data['currency'], false, false);
$total = $this->currency->format($product['quantity'], $this->session->data['currency'], $price_temp);
detailed discussion (ukrainian): https://forum.brocart.net/threads/okruglennja-cin.237/
The text was updated successfully, but these errors were encountered: