Re: Shopping cart Subtotal not equal Checkout Subtotal (rounding error)
Quote:
Originally Posted by
Reneetje
I never had any issues with this untill I recently had my shop upgraded tot 1.5.5b. Suddenly prices show incorrectly at checkout-page and are a cent off...in 1.5.4 all worked fine.
I tried the solution as mentioned by FRANK18 (post 14 and 44 )and see some differences but at the end when checking out the final confirmation does still not match.
How to fix...anyone has an idea?
Just tested my modifications (post 14 and 44) in a 1.5.5b installation and it still works as desired. Are you sure you applied all the changes as outlined?
1 Attachment(s)
Re: Shopping cart Subtotal not equal Checkout Subtotal (rounding error)
Running 1.5.5d here and we are seeing these rounding issues. Have applied the changes as suggested in post 14 and 44.
Attachment 16952
As you can see from the screenshot, the shopping cart total differs from the sub-totals at the checkout, although the overall total is correct. Have I missed something obvious? I've double checked, checked again..... Any tips would be appreciated.
Re: Shopping cart Subtotal not equal Checkout Subtotal (rounding error)
I just applied the changes to includes/classes/order.php and includes/classes/currencies.php as described in post #14 on a 1.5.5d store, and it looks like the rounding errors are fixed. I didn't apply any of the the other edits mentioned (as everything seemed to work already after I made those two changes).
Thanks for the fix and sharing! :smile:
Re: Shopping cart Subtotal not equal Checkout Subtotal (rounding error)
After Franks post 14 and 44 changes, (in 1.5.5e) I have a product priced at "0.9346" (so that w/ 7% sales tax it'd be exactly $1 (well calcs to 1.000022) and with (quantity) 3 of them in the shopping cart, the 7% sales tax calculated correctly at $.20, but the sub-total was always $2.99
...basically I changed all of the round( ..., 2) ...to two decimal places to rounding to 4 decimal places ...", 4)"
...I also didn't make (undid) the function_prices.php 4 to 2 changes (i.e. > "4, '.', '')" becomes "2, '.', '')" I didn't do it)
...and it works for me as it should in my opinion calculating to $3 for (3 x .9346) * 1.07 = (3.000066) aka $3 not $2.99
Re: Shopping cart Subtotal not equal Checkout Subtotal (rounding error)
Quote:
Originally Posted by
wolfderby
After Franks post 14 and 44 changes, (in 1.5.5e) I have a product priced at "0.9346" (so that w/ 7% sales tax it'd be exactly $1 (well calcs to 1.000022) and with (quantity) 3 of them in the shopping cart, the 7% sales tax calculated correctly at $.20, but the sub-total was always $2.99
...basically I changed all of the round( ..., 2) ...to two decimal places to rounding to 4 decimal places ...", 4)"
...I also didn't make (undid) the function_prices.php 4 to 2 changes (i.e. > "4, '.', '')" becomes "2, '.', '')" I didn't do it)
...and it works for me as it should in my opinion calculating to $3 for (3 x .9346) * 1.07 = (3.000066) aka $3 not $2.99
Could you please take a peek at post #34 and then post your corresponding settings (the actual settings in your store) here.
Thanks
Re: Shopping cart Subtotal not equal Checkout Subtotal (rounding error)
Quote:
Originally Posted by
frank18
Could you please take a peek at post #34 and then post your corresponding settings (the actual settings in your store) here.
Thanks
Here are my settings:
Tax Decimal Places 0
Display Prices with Tax false
Display Prices with Tax in Admin false
Basis of Product Tax Store
Basis of Shipping Tax Store
Sales Tax Display Status 0
Show Split Tax Lines false
Actually frank, I think I messed something up w/ this because now my payment modules aren't loading properly, I'm going to keep digging through the code today in hopes of figuring out why and post back.
Re: Shopping cart Subtotal not equal Checkout Subtotal (rounding error)
Turns out my test product happened to be virtual... so it wasn't anything I messed up. (Explained here: https://www.zen-cart.com/showthread....14#post1330114
Re: Shopping cart Subtotal not equal Checkout Subtotal (rounding error)
Quote:
Originally Posted by
GoverT
Solved! (At least for us)
Line 456 of includes/classes reads:
'final_price' => zen_round($products[$i]['price'] + $_SESSION['cart']->attributes_price($products[$i]['id']), $decimals),
It should be without rounding:
'final_price' => $products[$i]['price'] + $_SESSION['cart']->attributes_price($products[$i]['id']),
Then everything is fine! :D
Hope this works for you too frank18!
Trying to get rid of the subtotal error in zc v1.5.5e, I found this post, among many other posts(!).
I only changed this line in v1.5.5e. and the subtotal error disappeared.
Still have to look at all the other changes that need to be done related to rounding errors.
However, I wonder why rounding was introduced at this line in the first place. ZC v1.5.4 didn't have it. I checked in previous v155's and I saw it introduced in v155, includes/classes/order.php, @version $Id: Author: DrByte Fri Jan 1 12:23:19 2016 -0500 Modified in v1.5.5 $.
I wonder why that was needed at that time.
Anybody any thoughts?
Thanks,
jpda
3 Attachment(s)
Re: Shopping cart Subtotal not equal Checkout Subtotal (rounding error)
Ok so once again I am struggling with this and not sure where to go - I have had -frank18 changes working perfectly in ZC153 for ages (14 & 44) - however only when we started to look at changing prices have we spotted that there are still 2 places where the price is incorrect - not sure if these are new or old changes though... and not sure which PHP files to check
So ZC 153
UK VAT
Prices inclusive shown
you can see from my 3 attachments that when you look at the
Product Price Manager page the price next to the dropdown is wrong - rounding up
The price in catalog > Categories/Products - inline price shown here is also wrong - again by 1p
and lastly when the order has been completed the invoice itself - the inline prices in the table are also wrong - but sub total and vat total etc are correct
Any ideas which files to check to try to correct these 3 locations please?
Thank you
Sarah