Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2004
    Posts
    120
    Plugin Contributions
    0

    Default Wrong calculation

    Subototal : 44,00 €
    Free shipping : 0,00 €
    Group discount 30%: -13,20 €
    TAX 20% : 5,13 €
    Total : 28,60 €

    This is what i get on checkout. But 44,00€ - 13,20€ = 30,80€ not 28,60€

    What's wrong here?

    Tnx

  2. #2
    Join Date
    Apr 2004
    Posts
    174
    Plugin Contributions
    0

    Default Re: Wrong calculation

    exact same problem here

    any help?

  3. #3
    Join Date
    Apr 2004
    Posts
    174
    Plugin Contributions
    0

    Default group pricing discount not correct

    Hi all,

    the group pricing module is not calculating the discounts correctly.


    I.E.
    Subototal : 44,00 €
    Free shipping : 0,00 €
    Group discount 30%: - 15,40 € (correct would be -13,20 €)
    TAX 20% : 5,13 €
    Total : 28,60 €

    This is what i get on checkout. But 44,00€ - 13,20€ = 30,80€ not 28,60€

    Where is the calculation done and what is wrong?

    Thanks a lot

  4. #4
    Join Date
    Jan 2009
    Posts
    61
    Plugin Contributions
    0

    Default Re: group pricing discount not correct

    I am experiencing the exact same issue with group pricing.
    Has anyone resolved this?

    Sean

  5. #5
    Join Date
    Mar 2004
    Location
    Finland
    Posts
    488
    Plugin Contributions
    3

    Default Re: group pricing discount not correct

    There's a piece of code in the ot_group_pricing like this:

    Code:
    $discount = ($order_total - $gift_vouchers) * $group_discount->fields['group_percentage'] / 100;
    $od_amount['total'] = round($discount, 2);
    
    $ratio = $od_amount['total']/$order_total;
    
          /**
    
           * when calculating the ratio add some insignificant values to stop divide by zero errors
    
           */
    I don't have any idea why a small ratio to avoid divide by zero errors would be calculated this way ...

    With my 15,10eur test purchase and 3% discount, it sets the ratio to:

    0.45 / 15.1 = 0.0298013245033

    0.45 is the right discount, but for somereason the 0,029801... is added to the discount a bit further down in the code.... Why?


    Anyway, I got my discounts working by adding a truelly insignificant ration of 0.0000000001


    So replace
    $ratio = $od_amount['total']/$order_total;

    with
    $ratio = 0.0000000001;

    in the module code and it should work!
    Working with Zen Cart since 2003 :: www.prr.fi
    Author of the original Finnish language pack for Zen Cart since 2004

  6. #6
    Join Date
    Mar 2004
    Location
    Finland
    Posts
    488
    Plugin Contributions
    3

    Default Re: group pricing discount not correct

    ok... disrecard what I just posted

    It only works with certain cases and will not work in most cases

    The problem with the ot_group_pricing module seems to be, that if you calculate the discount so it includes shipping it works, but if you don't want to calculate it with shipping, it deducts the shipping cost from the order_total before calculating BUT does not remove the shipping costs TAX from the order_total tax field when it calculates the new tax... Thus the shipping costs tax is still calculated even there's no shipping included in the discount!

    makes any sense?

    Please make these damn modules more straight forward with in 2.0 PLEASE!
    Working with Zen Cart since 2003 :: www.prr.fi
    Author of the original Finnish language pack for Zen Cart since 2004

 

 

Similar Threads

  1. v154 Group Pricing Discount and Discount Coupons show on checkout, paypal/eway charge full
    By edvon in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 22 Sep 2015, 02:27 PM
  2. Free Standard Shipping only for Customers who DO NOT receive Group Discount Pricing?
    By lauriek in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 28 Aug 2009, 02:19 PM
  3. group pricing discount?
    By balihr in forum Managing Customers and Orders
    Replies: 2
    Last Post: 29 Jan 2009, 11:26 PM
  4. Group pricing - show discount
    By stoscano in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 27 Sep 2007, 06:55 AM

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