Quantity Based Discount Pricing

This form facilitates upload and development of quantity based product discounts. Discounts can be a % off, a fixed amount off the regular price, or a fixed price. Please read the info below before using this feature.
Cart ID:    (x-XXXX)


Using the discount system is fairly straightforward. Let's start with an example line of discount code (colors added for clarity):
widgeta~3=P.95 If a shopper adds 3 or more of an item with the part number widgeta to the cart, they pay 95% of the programmed cost (5% discount).

The cart displays the single "unit" price as usual, but the "cost" for the three would look like this: $29.97
We use separator characters to make the discount code lines easy to parse and understand.

The ~ (tilde) separates the part number matched, or Match Code, from the Quantity Breakpoint and Discount Action.

The = (equal) separates the Quantity Breakpoint from the Discount Action.

For two or more discount levels for a given Match Code, use yet another separator, the ^ (caret): widgeta~3=P.95^5=P.8^10=P.7 As you may have surmised, repeatedly using the caret separator allows concatenation of as many Breakpoint=Action combinations as you wish.
To discount a Fixed $ amount instead of a percent, structure the discount code line as follows: widgeta~3=F1.25 Can you guess what the discount action F1.25 did? You are correct if you said it subtracts a Fixed $1.25 from the regular price of the item.
The last of the three action codes is C, which ignores the regular price of the item, and charges a specific Cost: widgeta~3=C1.25 Three or more widgeta's are going to Cost the shopper $1.25 each. Less than three would of course be charged at the regular price, since the first quantity breakpoint has not been reached. (Regular price is what is coded into the "item" variable on your product html pages.)
Our discount feature will allow you to enter many discount code lines, up to one for every part number you have if you wish. One important capability remains to be discussed. What if you wanted your quantity breaks to apply to all widgets? Observe: widget.*~3=P.95 The above code would counts any part number starting with "widget" towards the breakpoint of three. Two widgeta's and one widgetb would cross the threshold and give the shopper a 5% discount on each widget. The key is the .* code, which matches . (dot - any single character) followed by * (asterisk - zero or more occurances of preceding character).

What are we talking about? The discount system uses a very powerful matching routine called "regular expressions". Regular expressions can get incredibly complex if you let them. If you don't understand them, keep it simple and you'll be ok. We'll provide some example match codes here that should cover most situations.

widgeta matches just "widgeta"
widgetb matches just "widgetb"
widget. matches "widgeta" or "widgetb", but NOT "widgetax" or "widget"
w.dget matches "widget" or "wadget"...any single char where the dot is
.*widget matches any partnumber ENDING with widget, but NOT "widget" by itself
.*widget.* matches any partnumber with widget in the middle but NOT "widget" by itself
*widget* matches any partnumber with widget anywhere inside, INCLUDING "widget" by itself
widget[0-9] matches "widget0", "widget1"... "widget9", but NOT "widgeta"
* matches EVERYTHING. What an easy way to have a sale!

If you want to temporarily disable a discount code line, just put a ! (exclamation) character as the first character on that line: !widgeta~3=P.95 Commenting makes it easy to turn discounts off and on without having to type (paste) them into the form again.