Zen Cart Logo
Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / group pricing discount not correct

group pricing discount not correct

Locked

Views: 4,009

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
14 Feb 2008, 2:20 PM
#1
teva avatar

teva

Zen Follower

Join Date:
Sep 2004
Posts:
101
Plugin Contributions:
0

group pricing discount not correct

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

30 Apr 2008, 12:13 PM
#2
dontino avatar

dontino

Zen Follower

Join Date:
Apr 2004
Posts:
155
Plugin Contributions:
0

Re: group pricing discount not correct

exact same problem here

any help?

30 Apr 2008, 12:16 PM
#3
dontino avatar

dontino

Zen Follower

Join Date:
Apr 2004
Posts:
155
Plugin Contributions:
0

Re: 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

10 Feb 2009, 11:45 PM
#4
srt9969 avatar

srt9969

New Zenner

Join Date:
Jan 2009
Posts:
62
Plugin Contributions:
0

Re: group pricing discount not correct

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

Sean

1 Jul 2009, 12:38 PM
#5
pasi avatar

pasi

Zen Follower

Join Date:
Mar 2004
Location:
Finland
Posts:
435
Plugin Contributions:
1

Re: group pricing discount not correct

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

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

1 Jul 2009, 3:00 PM
#6
pasi avatar

pasi

Zen Follower

Join Date:
Mar 2004
Location:
Finland
Posts:
435
Plugin Contributions:
1

Re: group pricing discount not correct

ok... disrecard what I just posted :P

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

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!