Page 1 of 1

[1.4.7][Solved]Coupon not taking correct discount off?

Posted: Tue Apr 13, 2010 1:00 pm
by rathina
I set up a 10% off coupon code, but it doesn't seem to be taking 10% off. The item in question is $7, but the coupon code only takes off .49 cents.

I even tried using the 2222 coupon code (just changed the dates), it still is only taking off .49 cents.

How do I set it up so that it takes 10% off, because for a $7 item, it should be taking $.70 off.

Re: Coupon not taking correct discount off?

Posted: Wed Apr 14, 2010 12:48 am
by rathina
The newest, and after playing with it more this is what I have found out.

It does not matter the quantity of items are in the cart. If the cart total is above $10.00, then the 10% discount is applied correctly.

If the total of the cart is below $10, then the 10% discount is not applied. Instead my discount amount shows the multiple of what the total amount is. For example:

$5 total, discount is .25 cents
$6 total, discount is .36 cents
$7 total, discount is .49 cents
$8 total, discount is .64 cents.

As you can see, some how when it is below $10, the formula is like ( Total = $ x .$ )
When its above $10, then the 10% discount code works as intended.

Re: Coupon not taking correct discount off?

Posted: Wed Apr 14, 2010 1:30 am
by Qphoria
Try this:

1. EDIT: catalog/model/total/coupon.php

2. FIND:

Code: Select all

$coupon['discount'] = min($coupon['discount'], $coupon_total);
3. REPLACE WITH:

Code: Select all

if ($coupon['type'] == 'F') {
	$coupon['discount'] = min($coupon['discount'], $coupon_total);
}
I think I overlooked the fact that it could be a %

Re: Coupon not taking correct discount off?

Posted: Wed Apr 14, 2010 1:32 am
by i2Paq
Thanks!

Reported as a Bug Post any OpenCart 1.4.7 Bugs here!.

Re: [1.4.7][Solved]Coupon not taking correct discount off?

Posted: Wed Oct 06, 2010 2:55 am
by Joxe
I edited the php file, today, as mentioned but, 1st of all, the discount is not taken accurately. For example I have a product wich price is 6.99 and the discount shows me 0.70 when it should be 0.69, right?

Secondly, if I have more than one product in the cart (only tried with 2 product), the discount is only over the 1st product,ie, I get:

product 1: 6,99
product 2: 12,80
Discount (-10%): 0,70

Any help? :-\

Re: [1.4.7][Solved]Coupon not taking correct discount off?

Posted: Thu Oct 14, 2010 12:58 am
by junmoses
That is a good formula for doing a coupon code. That could make it all the items gives 10 percent discount. It is only for the below 10 dollars items.