I wanted to be able to grant users a coupon at registration, but only under certain circumstances. I was able to use the Rules module to configure the conditions I needed, but the Drupal 6 version of Ubercart Discount Coupons didn't appear to support Rules.

I borrowed heavily from the Discount Coupon User Registration module to write basic Rules support, which I'm attaching below (zipped because d.o doesn't allow .inc files to be attached). It's the first time I've written Rules integration code, so please let me know if there's anything I missed. That said, it appears to be working fine, in my initial testing.

CommentFileSizeAuthor
uc_coupon.rules_.zip888 bytesmatt v.

Comments

maxilein’s picture

Component: Code » Documentation
Category: task » support

Hi,
May I ask if this does reuse the same coupon for all users or does it issue individual coupons?
Thanks!

matt v.’s picture

@maxilein It's been quite a while since I wrote the code above, but looking over it again I believe it reuses the same coupon for all users. That said, I suspect it wouldn't be terribly difficult to adapt it to grant individual coupons, if Ubercart Discount Coupons is capable of generating them.