Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Help with Cart total / order sub total

    Hi all, I am hoping someone can help me. I am running v1.3.9h, when I have a sale applied to the store because it is a percentage off the items are rounded in the displaying in the store and in cart but when then cart total and checkout subtotal is addeded up it adds up the un-rounded figures. This causes sometimes for the total to be a penny out and causes PayPal website payments standard to not create the order.

    Can anyone point me to where the code is that calculates the cart total and subtotals in checkout so I can look to change so it adds up the rounded figures instead of the plain figures so it all matches up?

    Or if anyone knows of a better way to resolve this? Perhaps change the way the sale is calculated?

    Please don't say just use express checkout because I do not wish to use express. I am happy with WPS all apart from the I'd order that isn't going through because of this issue.

    Many thanks.
    Phil
    Phil Rogers
    A problem shared is a problem solved.

  2. #2
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Help with Cart total / order sub total

    ok so just found this code in includes/functions/functions_prices.php
    PHP Code:
     if (!$special_price) {
            return 
    number_format($sale_product_price4'.''');
          } else {
            switch(
    $sale->fields['sale_specials_condition']){
              case 
    0:
                return 
    number_format($sale_product_price4'.''');
                break;
              case 
    1:
                return 
    number_format($special_price4'.''');
                break;
              case 
    2:
                return 
    number_format($sale_special_price4'.''');
                break;
              default:
                return 
    number_format($special_price4'.''');
            }
          } 
    changed it to:

    PHP Code:
     if (!$special_price) {
            return 
    number_format($sale_product_price2'.''');
          } else {
            switch(
    $sale->fields['sale_specials_condition']){
              case 
    0:
                return 
    number_format($sale_product_price2'.''');
                break;
              case 
    1:
                return 
    number_format($special_price2'.''');
                break;
              case 
    2:
                return 
    number_format($sale_special_price2'.''');
                break;
              default:
                return 
    number_format($special_price2'.''');
            }
          } 
    seems to have done the trick! Any one know why this might be a bad thing to do and if it could produce a different problem please let me know.
    Phil Rogers
    A problem shared is a problem solved.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Help with Cart total / order sub total

    It might work for your unique situation, with your unique combination of tax rates and discounts/specials and your particular product prices and your particular demographic of customer who buys only a small number of any given item.

    It's not a suitable solution for universal use, especially if a store has products priced to many more decimal places or deals in large quantities. In those cases your changes would cause more pricing errors.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Aug 2009
    Location
    Bedford, England
    Posts
    966
    Plugin Contributions
    0

    Default Re: Help with Cart total / order sub total

    Quote Originally Posted by DrByte View Post
    It might work for your unique situation, with your unique combination of tax rates and discounts/specials and your particular product prices and your particular demographic of customer who buys only a small number of any given item.

    It's not a suitable solution for universal use, especially if a store has products priced to many more decimal places or deals in large quantities. In those cases your changes would cause more pricing errors.
    Thanks for letting me know :-) ill keep an eye on it but seems to have worked for me, recreated 2 of the orders that didn't work before and now they work :-)
    Phil Rogers
    A problem shared is a problem solved.

 

 

Similar Threads

  1. v151 order total different from cart total
    By s_p_ike in forum Bug Reports
    Replies: 9
    Last Post: 9 Dec 2012, 09:29 AM
  2. shopping cart total and sub total missmatch v1.3.8
    By James Dunstone in forum General Questions
    Replies: 0
    Last Post: 15 Jun 2011, 09:51 PM
  3. Sub-total and total price are the same, please help!
    By albertvn in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 5 Jan 2010, 02:13 AM
  4. Sub Total not matching actual total of products in order
    By PadreHomer in forum General Questions
    Replies: 0
    Last Post: 10 Sep 2008, 11:54 PM

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