Creating a “discount code” using coupons

This tutorial is about how to create a discount code off entire cart contents.

Applying to entire cart contents means applying to every entry of your pricing matrix.

So, the way is to create an external variable, create a discount rule, and apply that rule to all of your pricing matrix entries.

A quick step-by-step guide:

1) go In PRODUCT CONFIGURATOR OPTIONS => Manage/Define External Variables
2) Add a new variable named “coupon_code” and set both Show in cart as coupon code and Expire With Submittal to yes
3) click on top the Manage/Define External Variables Rules link
4) add a rule with:
Rule Name: discound_fullcart
Rule Desc: 20% off
Source Variable: coupon_code
Checkvalue: MyCouponCode
Modifier: 0
% Modifier: -20
5) open a product with PRODUCT OPTIONS => Configure Products => [your product] => Configure Pricing Structure
6) click the Apply External Variables Rules button
7) enable the discound_fullcart rule for all of the visible values
8) repeat 5-6-7 for all the products you want to be affected by the discount rule

That’s basically it. Once done, the customer will see in cart a coupon code area.
If he will enter the MyCouponCode value, rule will become active and, with this setup, would apply a -20% to every used price value.
If in future you want to change the discount, you can edit the rule and edit the modifier.
If you think you’ll want multiple discount codes (for example, one for -15% and one for -20%), just create another rule and assign that too to all of your products.

For this reason, it could be a good idea to create a couple “zero rules” (so rules with ZERO modifiers that will not affect pricings) and assign them all when performing steps 5-6-7 the first time.
In other words, have them already there as placeholders, so it will be very quick to add multiple codes in case you’ll ever need them.

AND WHAT IF I WANT TO USE MULTIPLE CODES INSTEAD OF A SINGLE ONE?

For step #4 it is now possible to upload a Muptiple Codes File, instead of activating the rule against a single checkvalue match.
You need to create a simple text file, and place one valud coupon code per each line. So, something like this:

MyCouponCode_1
MyCouponCode_2
MyCouponCode_3
etc…

If you’ll upload such file into the new Multiple Checkvalues File field, all those codes will be valid matches for the rule.
Moreover, when one of the codes is used and an order is sent by making use of it, the used code will be removed from the file.
When the file will have no more codes, rule will basically become inactive.
This is the best way to have mutliple dicount codes that can be used only once.

This quote is from the Manage/Define External Variables Rules page:

CHECKVALUE AND MULTIPLE CHECKVALUES FILE
If you fill the checkvalue field, passed string will be checked against it.
Multiple Checkvalues File can be used if you want multiple checkvalues to be valid for the same rule.
If you will upload a file, the checkvalue field will be forced to be empty.
Moreover, when an order is submitted and one of the values defined in the Multiple Checkvalues File is used, that value will be removed from the file.

So, Multiple Checkvalues File is the method to use in case you want to provide your customers codes that can be used only one time (for example, discount codes for a campaign)
——-> The file you have to submit must be a simple text file, with one code per line. <——-
If the file is uploaded, this page will also show how many codes are still available.
When a customer will use the latest available one you will read 0 entries left and the rule will be no more active until you upload a new file, or remove the file and set a single checkvalue.

The update announcing this new feature is here