New Promocodes Usage Sept 2020
New Promocode Usage 9/2020
Promocode support using Per Item has been expanded to allow for including the children of an entire Catalog or Template Group’s via the container’s u_id, instead of listing all of the u_id’s for the Templates and/or Options to be discounted. This is made possible by the use of special values with controls included in the item list: &include;, &exclude;, &includeAndDesc(pos); and excludeAndDesc(pos); the "pos" in the parenthesis restrict what the includeAndDesc applies to: products (p), options (o) and shipping (s) methods. They can be in any order and only those types identified by the p, o and/or s will be included.
For instance, if you have a Catalog with a u_id of Products, and you wanted to offer a 25% discount on all product and options in that Catalog for a per item discount you would list it as &includeAndDesc(po);,Products
To discount just the products for a Template Group whose u_id is Metal, but not the options, it would be &includeAndDesc(p);,Metal for the Include value:
The functions can also exclude certain items that are in the descendants of the catalog/group as well, for instance maybe if a couple of larger format sizes are off limits or canvas groups. So the list can define both items to be included as well as items to be excluded from the set of product to which this promo code applies. . When parsing through the list, if the item encountered is one of these special values, then any values beyond this special value will be considered to be defining and include or exclude value depending on the special value. For example:
&includeAndDesc(po);,Products,&excludeAndDesc(po);,Canvas
would discount everything in the Products catalog as above but not discount anything in the Canvas group that is inside the Products catalog.
The normal "include" and "exclude" popup menu selections in the PromoCode Manager sets the initial default mode for parsing; so "include" is the same as preceding your list with "&include;, " and "exclude" is the same as preceding your list with "&exclude;, " This means that currently defined promo codes will operate just as they did before, no changes are needed.
The &includeAndDesc(pos); causes an item to be considered "included" if any of the includeAndDesc values appear in its ancestry in the lab catalog.
Similarly, &excludeAndDesc(pos); causes an item to be considered "excluded" if any of the excludeAndDesc values appear in its ancestry.
For example, let's say we wanted a promo code to apply to all canvas products, but not the options, that we have in one group within our catalog as well as to all of our large format products and not their options in another group, the item list might look like:
&includeAndDesc(p);,canvas,largeformat
Again, this is where canvas and largeformat are defined as the u_id values for those template groups in Template Tool. Now if we wanted to exclude a particular large size, say the 40x60 canvas with u_id -7f8e the entry would look like this:
&includeAndDesc(p);,canvas,largeformat,&exclude;,-7f8e
The sequence does not matter, so the above could also be defined:
&exclude;,-7f8e,&includeAndDesc(p);,canvas,largeformat
Technically the 40x60 is both included by the includeAndDesc and excluded by the exclude, but when an item is both included and excluded, the exclude wins.
You can use whatever groupings you want here, really. For instance, if you wanted to discount the large format options also, but not for canvas, and still exclude the 40x60 canvas the entry would be either of:
&includeAndDesc(p);,canvas,&includeAndDesc(po);,largeformat,&exclude;,-7f8e
&exclude;,-7f8e,&includeAndDesc(p);,canvas,&includeAndDesc(po);,largeformat
Strings for Messages for Promocodes Use (These are supported in the templates file on the Configuration element):
PromocodesAlreadyConsumed="Sorry, it looks like you've already used this code."
PromocodesAlreadyConsumedByCustomer="Sorry, it looks like you've already used this code."
PromocodesExpired="Sorry, this code has expired."
PromocodesNotFound="Sorry, we couldn't find a promotion with this code."
PromocodesNotThisConfig="Sorry, this promotion is only available on a different setup."
PromocodesNotYetValid="Sorry, this code isn't available yet, but please try later!"
PromocodesOtherError="Sorry, we couldn't find a promotion with this code."
PromocodesOtherItems="Sorry, this code doesn't apply to these products."
Promocodes.Accepted="<html><center>You save ${PROMO_DISCOUNT_PERCENT}% (${PROMO_DISCOUNT_AMOUNT}) with ${PROMOCODE}!<br><br>Your total is now ${order_total}"
Formatted for client configuration
Promocodes.Accepted="<html><center>You save ${PROMO_DISCOUNT_AMOUNT} (${PROMO_DISCOUNT_PERCENT}%) with ${PROMOCODE}!<br><br>Your total is now ${ORDER_TOTAL}</html>"
Promocodes.Minimum="<html><center>${PROMOCODE} doesn't apply until your<br>order reaches ${PROMO_MINIMUM}"
Formatted for client configuration
Promocodes.Minimum="<html><center>${promocode} doesn't apply until your<br>order reaches ${promo_minimum}</html>"
Promocodes.ExcludesShipping=" (excludes shipping)."