Page 1 of 1

Coupons can be used multiple times

Posted: Wed Feb 07, 2018 9:03 am
by AidanCKY
Hello

I'm running OpenCart 2.3.0.2. Using the standard coupon feature is causing me issues - we have a coupon with a 15% discount.

"Uses Per Coupon" is Blank, for unlimited
"Uses Per Customer" is 1.

If it's entered on the checkout page multiple times, it allows customers to discount the cart 5+ times. You can also use the coupon code with a Space, 2 spaces, 3 spaces at the end and it still works.

Shop is also running Journal 2.

Any ideas?

Re: Coupons can be used multiple times

Posted: Thu Feb 08, 2018 6:43 pm
by paulfeakins
Can you confirm if this happens on a fresh install of 2.3.0.2?

Re: Coupons can be used multiple times

Posted: Thu Feb 08, 2018 6:55 pm
by thekrotek
All your issues are not related to Coupons extension, especially considering the multiple discounting. Default Coupons extension is pretty weak and has a very few options, but works more or less proper. I'd suggest you to start looking somewhere else.

Re: Coupons can be used multiple times

Posted: Wed Feb 21, 2018 8:34 pm
by sagraphics
We are having the exact same problem. Uses per customer is blank and uses per coupon set to 1 but coupon can be used multiple times.

Re: Coupons can be used multiple times

Posted: Wed Feb 21, 2018 8:55 pm
by thekrotek
sagraphics wrote:
Wed Feb 21, 2018 8:34 pm
We are having the exact same problem. Uses per customer is blank and uses per coupon set to 1 but coupon can be used multiple times.
No, it is not.

Re: Coupons can be used multiple times

Posted: Wed Feb 21, 2018 9:13 pm
by sagraphics
I am not sure what you mean by "no it is not". We supply credit notes in the form of coupons for customers, and we have tested with a used coupon where the number of uses is set to one but it can be used time and time again. There is no history recorded for the coupon. I've searched through the database tables for coupon history and it seems the only coupon uses that are logged are ones used by a logged in user.

Re: Coupons can be used multiple times

Posted: Wed Feb 21, 2018 11:35 pm
by Johnathan
Coupon counts are only decremented when the order meets one of the Processing or Complete order statuses, as set in System > Settings. My guess is that you're testing the same coupon with an order that does not meet one of those statuses, so its count hasn't been decremented. Try changing the order to one of those statuses (e.g. "Complete", by default) and see if it changes the behavior of trying to use it again.

Re: Coupons can be used multiple times

Posted: Wed Feb 21, 2018 11:52 pm
by sagraphics
Hi - we've marked the order as completed and the coupon history is still not recorded and the coupon can still be used.

Re: Coupons can be used multiple times

Posted: Thu Feb 22, 2018 7:22 am
by straightlight
sagraphics wrote:
Wed Feb 21, 2018 11:52 pm
Hi - we've marked the order as completed and the coupon history is still not recorded and the coupon can still be used.
For which OC version are you addressing this issue?

Re: Coupons can be used multiple times

Posted: Thu Feb 22, 2018 8:31 pm
by sagraphics
Version 2.0.1.1

Re: Coupons can be used multiple times

Posted: Wed Mar 07, 2018 4:49 am
by MrMac78
Hi, im having the very same issue.. (and tested on a clean install of OC 2.3.0.2 no mods)

Uses Per Coupon: blank
Uses Per Customer: 1

result - customer can use the coupon to get 10% discount an unlimited amount of times

However, what I did notice was the following orders where the customer has used that coupon more than once, the following order's status' are all set to Cancelled. I think it has a relation to this issue https://github.com/opencart/opencart/issues/3657

Changing the order status to Pending or Complete (as suggested above) had no effect, the customer can still use the coupon an unlimited amount of times.

Reading Daniel's rants to ppl's complaints about this order status & coupon issue in the github thread suggests that this is by design? WTF?

Anyway, even setting the coupon to
Uses Per Coupon: 2
Uses Per Customer: 1
Allows the coupon to be used an unlimited amount of time...
WTF!!!
How can this be fixed to work as it should???? And if it can't, hHas this be 'fixed' in OC3?

If not, think it's time to jump ship and try a new cart.. having read Daniel's comments in said thread and attitude to bugs. Shame really.

Re: Coupons can be used multiple times

Posted: Wed Mar 07, 2018 5:54 pm
by sagraphics
It really is ridiculous! I have much experience of both Virtuemart and Woocommerce and both function brilliantly in terms of coupons, so I don't see why OC shouldn't behave in the same way! For me, it seems to work when a user logs in to checkout, but not with a guest user. It's a site I've inherited and my client is starting to get impatient for a fix!

Re: Coupons can be used multiple times

Posted: Tue Aug 28, 2018 8:17 pm
by vipartneriai
I had the same problem on my OC 2.3.0.2. I also have a coupon, that might be used 1 time per customer, but found out that sometimes the same customer has used the same coupon twice.
I've tried to do tests and check how OC stores and checks info about coupons usage .

OC stores information about coupon usage into separate table oc_coupon_history. 2. When coupon is applied, OC checks this table by coupon_id and user_id and counts how many times the same coupon was already used by the same user.
I did the test order and found out, that OC stores coupon history record ONLY after order has reached Processing Order Status, which is defined in site settings. In our case Processing status was set to 3 (Shipped), before 1 (Received) and 2 (Processing).
But default new order status is 1 (Received), so while it has not reached 3 (Shipped), coupon history is not recorded, and so customer is able to use this code again. So only after I have done order edit and status set to Shipped, coupon history was recorded and coupon could not be used second time.

But then I tried to repeat the same but update order status to Shipped in order info window. And I was very surprised, that changing order status in this window does not create coupon history record! Completed status has not worked as well and only when I have set status to Shipped or Completed in order edit window it has been recorded.

So in my case the solution was to remember - when coupon is used, always change the order status to Shipped or Complete in order edit window.

Hope this information will be useful.

Re: Coupons can be used multiple times

Posted: Tue Aug 28, 2018 10:42 pm
by Johnathan
Coupons are counted as "used" when the order reaches a "Processing" or "Complete" status, as set in System > Settings > Option. If you want a coupon to be counted when reaching the status "Received", then you should add that to your "Processing" statuses in that area. That should also solve your issue, though changing the status to "Shipped" works as well.

Re: Coupons can be used multiple times

Posted: Wed Dec 12, 2018 12:26 am
by foobarac
I confirm what Johnathan is saying is correct (in 3.0.2.0 anyways).