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
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.

AttachmentSize
uc_coupon-5.x-1.x-dev-max_uses_fix.patch965 bytes

#1

longwave - February 13, 2009 - 17:04
Status:needs review» fixed

Committed to CVS.

#2

longwave - February 13, 2009 - 17:25

Also committed to D6 branch.

#3

System Message - February 27, 2009 - 17:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#4

kees@qrios - July 11, 2009 - 20:11
Version:5.x-1.x-dev» 6.x-1.1
Status:closed» active

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

longwave - July 13, 2009 - 09:44
Status:active» postponed (maintainer needs more info)

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

kees@qrios - July 14, 2009 - 18:48
Status:postponed (maintainer needs more info)» closed

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!

 
 

Drupal is a registered trademark of Dries Buytaert.