Coupon Extensions for Zen Cart

This page describes coupon extensions using the following Zen Cart mods:

Using Coupons with Big Spender and Big Chooser

Big Spender and Big Chooser both have a "set_coupon" parameter (see here and here). This allows you to require a coupon to get a Big Spender/Big Chooser discount. This can be advantageous for several reasons:
  • You want to limit the number of times a discount can be taken, which can be done using the Uses Per Customer field of coupons (see Admin->Gift Certificate/Coupons->Coupon Admin->Edit)
  • You want to track how many times a specific discount is taken, which can be done using coupons
  • You want to limit a discount to only certain customers (who have been informed of the coupon code through a specific advertisement or promotion).
The only downside is that the human interface is a bit odd, for a specific reason: in order to make the Zen Cart coupon system work, you must give the coupon a dollar amount or make it a free shipping coupon. You cannot simply create a $0.00 coupon and use this as your coupon in the set_coupon parameter. Since free shipping is sometimes not feasable, this means you will see your discount, plus a one penny additional discount.

Payment Page displaying Big Chooser Discount based on coupon

Payment page showing Big Chooser Discount based on coupon

Update 10/04/08 I have also tested in Zen Cart 1.3.7 and 1.3.8 the creation of a coupon of $0.001, which has the advantage of showing up as $0.00 in the checkout page but still recording correctly in the coupon tracking table. This example shows an AutoCoupon, but using a regular coupon works just as well.

Payment Page displaying Big Chooser Discount based on coupon

Payment page showing Big Chooser Discount based on coupon

Using Auto Coupons with Big Spender and Big Chooser

If you are using an automatic coupon generating program such as Spender AutoCoupon or Chooser AutoCoupon, you can make a coupon generated by this system a dependency for a Big Spender or Big Chooser discount. This is what the set_auto_coupon() parameter does. For instance, suppose you want to create a 20% off coupon good for 30 days automatically for people who spend $100 or more. Using Spender Autocoupon, you would put the following in your includes/modules/spender_autocoupon.php file:
         $this->add_threshold(100, 'Spend over $100 get a 20% off coupon', 'TEMPLATE_SAVETWENTY', 'SAVETWENTY_100', 30, 'D', 1);
where TEMPLATE_SAVETWENTY is a 20% off coupon. But suppose you want this to have more impact: for instance, an additional 25% of items from category 3. Create the following Big Chooser discount (i.e. edit includes/modules/order_total/ot_big_chooser.php and add this to the setup function):
         $this->add_condition('25% off category 3', true);
         $this->set_discount(CAT, 3, '*', "%", 25);
         $this->set_auto_coupon("SAVETWENTY_100");
Note that SAVETWENTY_100 is the new coupon name from the add_threshold command from Spender AutoCoupon.

Payment Page displaying Big Chooser Discount and AutoCoupon discount

Payment page showing Big Chooser Discount and AutoCoupon discount

Finally, you can create an AutoCoupon which is specifically designed for use with Big Chooser or Big Spender. For instance, suppose you wanted to have a special where with a purchase of $100 or more, you would create a 6 month coupon good for a free item from category 3 (shoes). Create a coupon for $0.01 called TEMPLATE_SHOES. Using Spender Autocoupon, you would put the following in your includes/modules/spender_autocoupon.php file:
         $this->add_threshold(100, 'Spend over $100 get a coupon for a pair of free shoes', 'TEMPLATE_SHOES', 'SHOES', 6, 'M');


Then create the following Big Chooser discount (i.e. edit includes/modules/order_total/ot_big_chooser.php and add this to the setup function):
         $this->add_condition('1 Pair free shoes (category 3)', false);
         $this->set_discount(CAT, 3, 1, "%", 100);
         $this->set_auto_coupon("SHOES");


Customers who checkout will now get a coupon with the code AUTO_xxx_yyy (where xxx is their customer id, and yyy is the entry number in the autocoupon table). When they redeem this coupon - which only they can use - they will see the following at checkout:

As another example of an AutoCoupon which is specifically designed for use with Big Chooser, consider the following example. Suppose you wanted to have a special where with a purchase of $100 or more, you would create a 3 month coupon good for a free item from MANUFACTURER 7 (Sony). Create a coupon for $0.01 called TEMPLATE_SONY. Using Spender Autocoupon, you would put the following in your includes/modules/spender_autocoupon.php file:
         $this->add_threshold(100, 'Spend over $100 get a coupon for free item from Sony', 'TEMPLATE_SONY', 'SONY', 3, 'M');


Then create the following Big Chooser discount (i.e. edit includes/modules/order_total/ot_big_chooser.php and add this to the setup function):
         $this->add_condition('1 free Sony item (MANUF 7)', false);
         $this->set_discount(MANUF, 7, 1, "%", 100);
         $this->set_auto_coupon("SONY");


This works the same way as the previous example.

Coupons don't know about Big Spender and Big Chooser

Remember that Coupons and Big Chooser don't know about each other; if you create a Big Chooser discount on Manufacturer Sony and make it dependent upon coupon Sony (as above), people can still enter the coupon code "SONY", and the coupon system will accept it. If they check out in this state, the coupon will be marked as used.

Of course, this same caveat applies to Coupons and Big Spender.



Certificates of appreciation most welcome!
If the information you learned reading this site is helping your store make more money, please consider making a donation. Thank you!


Want more Zen Cart?     Tips and Tricks     Contributions     Extensions     Custom Software     Newsletter

Terms | Privacy | SiteMap | Newsletter | Contact Me | Contents © 2003-2010 That Software Guy, Inc.
Zen Cart Project Home Page | Zen Cart Forum | Zen Cart™ is © Zen Ventures, LLC.