Page 6 of 6 FirstFirst ... 456
Results 51 to 59 of 59
  1. #51
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Shopping cart Subtotal not equal Checkout Subtotal (rounding error)

    Quote Originally Posted by Reneetje View Post
    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?

  2. #52
    Join Date
    Aug 2016
    Location
    Essex, UK
    Posts
    1
    Plugin Contributions
    0

    Default 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.

    Click image for larger version. 

Name:	Totals.jpg 
Views:	252 
Size:	21.5 KB 
ID:	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.
    Last edited by evilgrin; 24 Feb 2017 at 07:29 PM.

  3. #53
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default 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!

  4. #54
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default 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
    Last edited by wolfderby; 18 May 2017 at 07:25 PM.

  5. #55
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Shopping cart Subtotal not equal Checkout Subtotal (rounding error)

    Quote Originally Posted by wolfderby View Post
    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

  6. #56
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: Shopping cart Subtotal not equal Checkout Subtotal (rounding error)

    Quote Originally Posted by frank18 View Post
    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.

  7. #57
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default 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

  8. #58
    Join Date
    Jun 2014
    Posts
    138
    Plugin Contributions
    0

    Default Re: Shopping cart Subtotal not equal Checkout Subtotal (rounding error)

    Quote Originally Posted by GoverT View Post
    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!

    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
    Last edited by jpda; 13 Jun 2017 at 06:25 PM. Reason: typo

  9. #59
    Join Date
    May 2004
    Location
    UK
    Posts
    478
    Plugin Contributions
    0

    Default 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
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	mbd1.jpg 
Views:	55 
Size:	74.9 KB 
ID:	18013   Click image for larger version. 

Name:	mbd2.jpg 
Views:	51 
Size:	81.6 KB 
ID:	18014   Click image for larger version. 

Name:	mbd5.jpg 
Views:	49 
Size:	23.8 KB 
ID:	18015  


 

 
Page 6 of 6 FirstFirst ... 456

Similar Threads

  1. Shopping Cart - Subtotal $0.00
    By dmagic in forum General Questions
    Replies: 1
    Last Post: 9 Apr 2011, 03:38 PM
  2. again tax/VAT being calculated on subtotal ignoring group discount
    By SarahL in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 8
    Last Post: 8 Apr 2008, 06:42 PM
  3. Shopping cart subtotal font color help
    By bigad21 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 7 Aug 2006, 05:08 AM
  4. Shopping cart subtotal in header
    By businesstoweb in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 13 Jun 2006, 01:32 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR