By lanexa on
I have crawled the forums and only find discussion around issuing a coupon code at registration, not a UNIQUE coupon code.
The requirement is to pull unique coupon codes at user registration from the Ubercart-generated bulk coupon codes. Rather than pull from an additional table, I'm hoping there is a solution out there that leverages an existing module.
The site is running 6.x and Ubercart is able to generate the bulk codes via uc_coupon, no problem. I want to assign a unique code at registration of a new user and email that code to the new user.
Any direction is greatly appreciated.
Comments
my solution
Not sure why this post didn't gain any traction, but I thought I would take a moment to post my solution in case anyone else has this issue.
The bulk codes generated from Ubercart were dumped into a new MySQL table, and a simple PHP function was developed to pull a new code at the time of Drupal registration. The user id was passed into this function to ensure that a unique code was assigned to the correct user, and to make sure that no code was used twice.
In order to know who the user is that registered, here is my code snip:
I will post the function here if anyone is interested. Just let me know.
Chris
I would like to see your
I would like to see your solution Lanexa, I too need to do this same thing. Thanks!