Miva Merchant 4 Module FAQs » Coupon Manager (DEN_COUPON)


{docurl}

Can I generate a random coupon code using a token?

Yes, recent versions of Coupon Manager support random coupon code generation using OpenUI or Page Template tokens. Use the "check for upgrade" link to download the current release. The token format is

%module|DEN_COUPON|create(coupon_code,prefix,random_length,days_to_expire)|%

- coupon_code must be a coupon you have already created in Coupon Manager. All settings (coupon amount, minimum subtotal, etc.) for that coupon will be used to generate the random coupon.
- prefix, if used, will be the first characters of the coupon. This makes it easy to reference later. For example, to view all randomly generated coupons from this token in the coupons console, just search by the prefix.
- length is the number of random characters to use for the coupon code after the prefix.
- days_to_expire is the number of days from the date the coupon is generated for which it is valid. If left blank, the coupon will use the expiration date of the original coupon_code.

For example, the following token will generate a coupon code in the format AUTO-XXXXX (where 'XXXXX' is randomly generated) that will expire in 24 hours, otherwise using all settings from the coupon MYCOUPON.

%module|DEN_COUPON|create(MYCOUPON,AUTO-,5,1)|%

The following example shows how to include a random coupon using OpenUI Tokens in the customer confirmation email.

1) First, register a token for Coupon Manager in the tokens tab of your store settings. Use DEN_COUPON for the module code and token name.

2) In the Header field of the Customer Order Confirmation Email tab (in Order Fulfillment Configuration), place %OUI% at the very top.

3) Include the following where you want the coupon to display in the header.

Your order qualifies for an automatic coupon! Use the coupon code %module|DEN_COUPON|create(MYCOUPON,AUTO-,5,10)|% to receive %10 off your next order, offer valid for the next 10 days.

Of course, you can wrap this in other OUI Token checks. For example, the following conditional token would only generate a coupon if the order total is $100 or more.

%IF(Orders.d.total GE 100)%
Your order qualifies for an automatic coupon! Use the coupon code %module|DEN_COUPON|create(MYCOUPON,AUTO-,5,10)|% to receive %10 off your next order, offer valid for the next 10 days.
%IFEND%



Last update: 2004-09-30 04:51
Author: Support
Revision: 1.0

Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry