Page 1 of 2
Error with coupon code
Posted: Mon Jan 04, 2010 3:08 am
by mmi09
Hi guys ,
I've created a couple of coupons but everytime at the check out I get the Error: Coupon is either invalid, expired or reached it's usage limit. Any ideas on what the problem is , I've tried everything I can think of, I've checked the date , amount etc
Thanks
Mo
Re: Error with coupon code
Posted: Mon Jan 04, 2010 8:27 am
by readyman
Can you check your PHP log to see if there are any errors there?
Re: Error with coupon code
Posted: Mon Jan 04, 2010 8:31 am
by Qphoria
are you using todays date for starting date? Try yesterday
Did you assign any products to the coupon?
Remember its 2010 now

(i wrote 2009 twice already)
Re: Error with coupon code
Posted: Mon Jan 04, 2010 5:11 pm
by mmi09
All the start dates are before yesterday i.e. last year etc and all the end dates also have a lengthy time before it expires i.e. couple months or next year and no products have been assigned to it as I want it so it can be used on any product.
Re: Error with coupon code
Posted: Mon Jan 04, 2010 5:22 pm
by flyfishingcolorado
try assigning one product to the coupon by selecting a category in the drop down box and then moving one produt from left to right hand box with the directional arrows. Then try a test to see if that takes care of the invalid part.
Re: Error with coupon code
Posted: Mon Jan 04, 2010 6:00 pm
by 3rdcorner
I'm having a similar problem... except it says success your coupon has been applied!
There is no discount showing up however. I've tried using one product, letting it apply to all products by choosing none, percentage, fixed value... nothing works.
I've tried -10.00, 10.00, nothing...
Any idea what to do? I don't have access to the PHP log file
Re: Error with coupon code
Posted: Mon Jan 04, 2010 7:29 pm
by 3rdcorner
I've been through the entire coupon model and cart.php / cart.tpl...
There is no place where a discount is applied. Basically model/checkout/coupon.php checks if the coupon can be applied, then returns the coupon data.
After that controller/checkout/cart.php checks if $coupon is false, and if it's not returns 'success.'
That's all, no discount applied...
Re: Error with coupon code
Posted: Mon Jan 04, 2010 9:19 pm
by Qphoria
3rdcorner wrote:I'm having a similar problem... except it says success your coupon has been applied!
There is no discount showing up however. I've tried using one product, letting it apply to all products by choosing none, percentage, fixed value... nothing works.
I've tried -10.00, 10.00, nothing...
Any idea what to do? I don't have access to the PHP log file
This happens when the coupon is valid, but you don't have any products assigned to it in your cart
Re: Error with coupon code
Posted: Mon Jan 04, 2010 9:43 pm
by Xsecrets
also the order totals are not in the cart so you don't actually see the coupon applied other than the message. you will see it in the totals on the confirmation page.
Re: Error with coupon code
Posted: Mon Jan 04, 2010 10:50 pm
by 3rdcorner
The coupon doesn't get calculated until the confirmation page, which is a bit misleading so I added a message saying that you're discount will be applied in the last step before checkout...
Re: Error with coupon code
Posted: Tue Jan 05, 2010 12:06 am
by Qphoria
coupon code used to be on the last page.. it was moved to cart page but its not the best place. Moving it back to the final page would be best
Re: Error with coupon code
Posted: Tue Jan 05, 2010 12:35 am
by Xsecrets
Qphoria wrote:coupon code used to be on the last page.. it was moved to cart page but its not the best place. Moving it back to the final page would be best
I would have to agree that the cart is certainly not the best place for it as I'm sure most shoppers will bypass the cart all together when you are using ajax.
Re: Error with coupon code
Posted: Tue Jan 05, 2010 12:54 am
by Qphoria
exactly
Re: Error with coupon code
Posted: Tue Jan 05, 2010 12:59 am
by dbstr
One question - might be silly - but if it's on the confirm page, wouldn't it create an unnecessary "Missing Order", when you reload to page to fetch the coupon data? How would you avoid that?
Re: Error with coupon code
Posted: Tue Jan 05, 2010 1:52 am
by Qphoria
not too silly of a question.. It used to be on the confirmation page back in 1.3.2 and earlier.. but I've never bothered to check if it makes a new order id.. Theoretically you are right.
I suppose the real issue is the way it creates the order id. Perhaps the order id should be set to the session as soon as its created. Then check the session each time the confirm page loads. If there is already an order id, use that one instead of creating a new one.
I'll test this theory out. Still doesn't change the fact that coupon is still probably best done on the confirmation page unless the checkout design changes to accommodate different coupon possibilities better, like checking if its free shipping and forcing free shipping on the shipping page.
Really the coupon should maybe be added to the cart as a discount "item"
Then you'd see:
Code: Select all
Product 1 $51.00
- Color Red
Product 2 $14.00
Coupon ($10.00 off): -$10.00
Subtotal: $60.00
right in the cart.
Could also add the coupon field to the cart sidebox for those using ajax.
Re: Error with coupon code
Posted: Tue Jan 05, 2010 3:35 am
by Xsecrets
I would say the best place would be on the payment/shipping page. Well that is to say in a new version if we can do guest checkout all on one page why can't we put shipping/payment on one page for logged in customers then put the coupon code on that page.
of course the next best option would be to put it in the cart calculations, or simply leave it as an order total, but put the order totals in the cart. And off course as Q said you would need it in the cart box for people using AJAX.
Re: Error with coupon code
Posted: Tue Jan 05, 2010 4:39 am
by Qphoria
dbstr wrote:One question - might be silly - but if it's on the confirm page, wouldn't it create an unnecessary "Missing Order", when you reload to page to fetch the coupon data? How would you avoid that?
ok.. i've added a quick and easy mod to prevent this from happening here:
http://forum.opencart.com/viewtopic.php ... 453#p43453
Re: Error with coupon code
Posted: Wed Jan 06, 2010 12:07 am
by scwhost
Hello!
I am having this problems "I've created a couple of coupons but everytime at the check out I get the Error: Coupon is either invalid, expired or reached it's usage limit. Any ideas on what the problem is , I've tried everything I can think of, I've checked the date , amount etc" as well. I didnt read any where on this page where this issue was directly addressed. Can anyone help?
Kind Regards
SCW
Re: Error with coupon code
Posted: Wed Feb 24, 2010 7:32 pm
by jamesunique
Hi, I'm having the same problem, gone through the same processes - no joy.
In the first place it would be nice to have a fix for this as it stands but further down the line I agree that most people don't bother with the basket and go straight to checkout. In my view this is where you should enter a discount code.
Re: Error with coupon code
Posted: Tue May 11, 2010 12:36 pm
by rajeshram
I have a problem with this as well.
Ive narrowed down the problem.
Once the coupon is created with 10 or 20 available uses.. or any number .. it can be a 100.
When checking out, the first time the coupon works.
After the first time, it becomes invalid, no matter how many times you set the number of uses.