New Promocodes Usage Sept 2020
New Promo Code Usage for Per-Item Discounts (include, exclude)
Use this article to configure expanded per-item promo code include/exclude rules using catalog or template group u_id values and descendant controls.
Overview
Promo code support using Per Item has been expanded to allow the children of an entire catalog or template group to be included by using the container’s u_id, instead of listing every template and/or option u_id to be discounted.
This is done with special values in the item list: &include;, &exclude;, &includeAndDesc(pos);, and &excludeAndDesc(pos);.
Special Values
| Value | Purpose |
|---|---|
| &include; | Values after this marker are treated as items to include. |
| &exclude; | Values after this marker are treated as items to exclude. |
| &includeAndDesc(pos); | Includes an item when a listed value appears in that item’s ancestry in the lab catalog. |
| &excludeAndDesc(pos); | Excludes an item when a listed value appears in that item’s ancestry in the lab catalog. |
The pos value restricts what includeAndDesc or excludeAndDesc applies to: p for products, o for options, and s for shipping methods. These can be in any order, and only the identified types are included or excluded.
Catalog Include Example
If a catalog has a u_id of Products, and you want to offer a 25% per-item discount on all products and options in that catalog, use:
If this image does not display, open it directly: Productscode.PNG
Template Group Include Example
To discount only the products for a template group with a u_id of Metal, but not its options, use:
If this image does not display, open it directly: Metalcode.PNG
Combining Includes and Excludes
The functions can exclude specific items that are descendants of a catalog or group. This allows the item list to define both what should be included and what should be excluded from the set of products to which the promo code applies.
When parsing the list, if the item encountered is one of the special values, values after that special value are treated as include or exclude values depending on the marker.
For example, the following discounts everything in the Products catalog, but does not discount anything in the Canvas group inside that catalog:
Default Include / Exclude Mode
The normal include and exclude popup menu selections in PromoCode Manager set the initial default parsing mode.
- include is the same as preceding the list with &include;.
- exclude is the same as preceding the list with &exclude;.
Existing promo codes continue to operate as before; no changes are needed for already defined promo codes.
Additional Examples
Discount all products and options in a catalog with u_id Products
Discount only products in a Template Group with u_id Metal
Discount products and options in Products, but exclude products and options in Canvas
Apply to canvas products and largeformat products, not their options
Include canvas and largeformat products, but exclude a specific 40x60 canvas with u_id -7f8e
Same result with the exclude first
Include canvas products and largeformat products/options, but exclude the 40x60 canvas
Same result with the exclude first
The sequence does not matter. If an item is both included and excluded, the exclude wins.
Strings for Promo Code Messages
The following strings are supported in the templates file on the Configuration element.
Expected Result
Per-item promo codes can now target entire catalog or template group descendants using container u_id values, with optional include and exclude logic to control products, options, and shipping methods.
Escalation Notes
- Confirm the promo code is using a Per Item discount setup.
- Confirm the listed values match the correct catalog, template group, template, option, or shipping method u_id values.
- Confirm pos includes the intended item types: p, o, and/or s.
- If a specific product should not receive the discount, add an exclude entry. Remember that exclude wins when an item is both included and excluded.
- For custom customer-facing messages, configure the supported promo code strings on the Configuration element.