Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a need for a large number of coupons. If I choose to create 10,000 coupons, this module actually creates 10,000 coupons and stores them in the database. The way that uc_coupon does bulk coupons is it stores a seed, and then indexes into that seed to generate coupons. It's a more efficient approach than creating and storing the actual codes.
Comments
Comment #1
pcambraPatches are welcome :)
Comment #2
favrik CreditAttribution: favrik commentedI need this for yesterday. xD I'll contribute patches, just want to know if the following strategy is good for sharing (this is actually for 2.x-dev).
However, finding the code if we still use a Prefix, shouldn't be that hard.
Thoughts?
Comment #3
favrik CreditAttribution: favrik commentedOn second thought, I think creating a coupon_batch entity (or just a table) where the template used to create the coupons is stored plus a map between coupon batch template and coupon ids is better. This would keep simplicity in the coupon redeem process, and improve the UI so that you can easily identify coupons created in the bulk process, and possibly bulk-delete and bulk-edit them.
EDIT: Initial work on that idea: https://github.com/favrik/commerce_coupon_batch/tree/favs