Post by CreativeA » Wed Feb 03, 2016 7:08 pm

A client has reported an issue, which I was able to duplicate. A Google search showed others reporting the same issue including on GitHub, but I couldn't find a solution.

Installation is OpenCart 2.1.0.1

I also tested on OpenCart 2.0.3.1 and the bug happens in that install too.

Bug / Issue:

On the Coupons edit/add screen we should be able to restrict a coupon by "Uses Per Customer" or "Uses Per Coupon". Neither of these is working, resulting in a customer being able to use a code on repeated orders, despite the Uses Per Customer being set to 1.

Needing a fix ASAP - anyone any ideas?

Newbie

Posts

Joined
Wed May 01, 2013 10:00 pm

Post by ADD Creative » Wed Feb 03, 2016 9:13 pm

There was a similar issue with 1.5.x where payment methods that use callbacks wouldn't work correctly with coupons. It may still be an issue with 2.1.x. See here. http://forum.opencart.com/viewtopic.php?t=65018

What payment method are you using? Do you get the same issue with Cash On Delivery payment method?

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by CreativeA » Wed Feb 03, 2016 10:49 pm

Thank you so much for your reply. Appreciated.

After more testing and de-bugging this afternoon I've managed to get it resolved (all via admin settings without in the end having to delve in to the code!).

To assist others in future:

I realised that the Coupons are linked with order status. Thus the coupon was only restricting if the order status was "Pending".

I started with testing it through with Cash on Delivery. I went to PAYMENT METHOD > ORDER STATUS and checked what status it showed. If set to PENDING then it will restrict coupons. Anything else and it wasn't working.

I went to SETTINGS > OPTIONS > PROCESSING ORDER STATUS. Here I ensured all were selected (perhaps all are not needed I didn't do further testing with some de-selected). As it stood previously the ones selected were those that are present in the default install of OpenCart.

This now resolved it for Cash on Delivery.

The only status that caused the Coupon not to restrict now is if the order is set to Cancelled (which is preferable anyway).

I encountered further annoyance when ensuring the same applied to PayPal as despite all my PAYPAL > ORDER STATUS being as they should my test orders (of TEST product at £0.01) were going through but defaulting the order status to Cancelled. I realised this was because they were flagged as fraud and thus gave the SETTINGS > OPTIONS > FRAUD STATUS.

You can double check your coupon usage by COUPON > EDIT > HISTORY TAB. There you can see the orders it has been applied to. If it appears there it will be restricted from further use (assuming your coupon settings themselves are all correct).

One further note:

If you edit an existing order via ORDERS > EDIT. Make sure you re-apply the coupon so correct total is showing before re-saving or the coupon gets removed from the updated order. This doesn't apply when you ORDERS > VIEW and update the order status of course, which is the more preferable and speedy method of updating order status.

Newbie

Posts

Joined
Wed May 01, 2013 10:00 pm

Post by geotnt » Mon May 09, 2016 6:53 am

Has anyone had any success in getting single use coupons to work in OC 2.0 with Paypal transactions? My users are still able to use a coupon multiple times and nothing being recorded to the coupon history tab.

Any help would be appreciated.

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm

Post by ADD Creative » Mon May 09, 2016 5:26 pm

Have you set all your order statuses in the Processing Order Status option in the settings?

The help for this option reads.
Set the order status the customer's order must reach before the order starts stock subtraction and coupon, voucher and rewards redemption.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by geotnt » Tue May 10, 2016 6:13 am

Yes, I have. It still allows the use of a coupon by a single user multiple times and nothing shows in history

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm

Post by geotnt » Tue May 17, 2016 7:19 am

has anybody solved this issue for OC 2.0.3.1?

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm

Post by ADD Creative » Tue May 17, 2016 7:38 pm

Do you get the same issue with Cash On Delivery payment method?

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by geotnt » Wed May 18, 2016 6:08 am

ADD Creative wrote:Do you get the same issue with Cash On Delivery payment method?
I haven't tried COD, because our site doesn't accept that payment method. Maybe I should try it?

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm

Post by ADD Creative » Wed May 18, 2016 10:31 pm

It's a simple payment method and would maybe help highlight where the problem is.

What payment methods are you currently using? And what do you have the order statuses to in that payment method?

Also what statuses have you ticked in Processing Order Status in the settings?

A few more threads on the topic that may help.
viewtopic.php?f=190&t=159069
viewtopic.php?f=191&t=145825
viewtopic.php?f=191&t=137616

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by geotnt » Thu May 19, 2016 6:45 am

I'm only using PayPal Standard as a payment system. All items for sale are downloadable files, so no other method is required, or wanted.

I've set the order statuses in Paypal standard to match their names. I.E. Pending = pending, Processed = processed, etc.

In Systems > Settings, I tried it as the earlier person mentioned and ticked all options under Processing Order Status and now the coupons work as expected in COD mode (enabled for testing) with the history updating, etc. However, it still doesn't work properly when using paypal as a payment method.

The other threads didn't give me much of an idea of anything to try either. I did see one thread somewhere that had you modify the coupon.php file and one other php file. Guess that's worth a try, unless you have any ideas...

New member

Posts

Joined
Sat Sep 26, 2015 11:32 pm
Who is online

Users browsing this forum: No registered users and 4 guests