Running 1.5.5d here and we are seeing these rounding issues. Have applied the changes as suggested in post 14 and 44.
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.
Last edited by evilgrin; 24 Feb 2017 at 07:29 PM.
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!
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
Last edited by wolfderby; 18 May 2017 at 07:25 PM.
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.
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
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
Last edited by jpda; 13 Jun 2017 at 06:25 PM. Reason: typo
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
Bookmarks