Max Uses not working
smccabe - February 10, 2009 - 19:40
| Project: | Ubercart Discount Coupons |
| Version: | 6.x-1.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Max uses isn't actually working, there is a problem with the SQL statement and checking status > 0 when status is not an int. Here is a patch that uses the status weight to do it properly. Another developer were I work made this patch and I reviewed it, also it is being used on a live site so it shouldn't need much more review.
| Attachment | Size |
|---|---|
| uc_coupon-5.x-1.x-dev-max_uses_fix.patch | 965 bytes |

#1
Committed to CVS.
#2
Also committed to D6 branch.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.
#4
Please close again when I'm wrong.
Max uses is not working in 6.x-1.1. Not for all users nor per user.
I still can apply a coupon code multiple times with max uses set to 1. I tested several existing users and anonymous.
D6.13 + Ubercart 2.0 rc3. Pretty clean install.
Thanks,
Kees
#5
For a coupon to be counted as used, the order it was attached to must be in "Payment received", "Processing" or "Completed" state; this avoids orders that were abandoned at "in checkout" from counting towards coupon usage, when it is likely they will never be completed. What order statuses were you using in your tests? This really points to the fact I need to write some actual documentation for this module!
#6
You are right indeed. The test orders where still in "checkout", setting one to e.g. "payment recieved" activates the counter and the max limit.
Thanks!