Right now any coupon code that get's attached to an order will be considered used.

For most cases, this is a pretty poor behavior.

Consider an anonymous user that gets a coupon code through a purchase and wants to use the code. He finds stuff to buy, enters the code but is note sure if he wants to get something else and doesn't complete the order.

He then opens the site the next day

• After having cleared his cookies
• On a different browser/computer

His code (1 time use only) is now considered used, and there's a good chance he even can't access the order with the code on it - it's gone forever. I think we can do better than this.

Comments

Status:Active» Needs review
StatusFileSize
new2.16 KB

I have created a patch, that will allow users to setup which order statuses that should mark a coupon code as used. The default values is the completed and canceled states, which will give the desired default behavior.

In related to this issue - I added a feature to automatically remove unused coupons from orders when the coupon no longer can be used (all the uses have been spent). This depends on the original patch for this issue.

Hi,

I just tested the patch in #1 and it works. There is a slight problem. When user1 adds the coupon in checkout and doesnt complete the order, user2 can still add the same coupon on checkout. Then user1 completes the order. User2 can as well complete the order with the same coupon and doesnt get any error that the coupon has been already used. This bring me to point that the patch solves the above issue but opens a new one, which in some cases can be serious.
The patch #2 cannot be applied anymore to the newest version.

Thanks

Issue summary:View changes
Status:Needs review» Needs work