The tables in this section demonstrate how to represent some standard promotions using PMDL rules in the discount rule editor.

For more examples of PMDL Rules, see the Creating and Maintaining Promotions chapter of the ATG Commerce Guide to Setting Up a Store.

Item Pricing Model Examples

The following table describes how to set up Item pricing models using PMDL rules:

Percentage off price:
Get Y for 25% off.

The “25% off” part of this rule is contained at the PricingModel level. You can create an “Item Discount - percent off” promotion, then set its adjuster to 25.

The PMDLRule describes Y. For example, if Y is something blue, the following is one possible PMDL representation:

“always discount every item whose SKU’s color is blue”

This rule is written for items that register their color in the “color” property of their SKU.

Dollar amount off price:
Get Y for $10 off

The “$10 off” part of this rule is contained at the PricingModel level. You create an “Item Discount - amount off” promotion, then set its adjuster to 10. The PMDLRule describes Y. For example, if Y is something red, the following is one possible PMDL representation:

“always discount every item whose SKU’s color is red”

This rule is written for items that register their color in the “color” property of their SKU.

Fixed pricing:
Get Y for $0.25

The “$.25” part of this rule is contained at the PricingModel level You create an “Item Discount - fixed price” promotion, then set its adjuster to .25. The PMDLRule describes Y. For example, if Y is something green, the following is one possible PMDL representation:

“always discount every item whose SKU’s color is green”

This rule is written for items that register their color in the “color” property of their SKU.

Note: You can create a rule that gives a discount to a product that is in a specific category. For example, you could create a rule that gives a 10% discount to all products that are part of the shoe category. This rule converts to give a discount to a “CommerceItem whose auxilliaryData.productRef.ancestorCategoryIds contains categoryIdX.” By default, the productRef is an item from the Product Catalog. To use a rule that discounts based on category, the productRef needs to have its ancestorCategoryIds populated. If this property is not populated, rules of this type always evaluate to false. For more information on the product catalog, see the Using and Extending the Standard Catalog chapter.

Quantity Pricing Model Examples

The quantity rules have one thing in common: they all depend on a set of items that match the description “X.” A number of X items are needed as a precondition for the rule being applied to any items. By default, the items that act to satisfy this precondition are not eligible to receive the discount.

The following table describes how to set up quantity pricing models using PMDL rules:

Buy one, get one free

If the free item is “anything blue” then the rule is actually “buy one blue item, get one blue item free.”

The “free” part of the discount is configured in the promotion itself. Create a “Item Discount – fixed price” promotion. Set the adjuster to Zero.

Next, create the following PMDL representation:

“For next 1 items whose SKU color is blue, discount up to 1 items whose SKU color is blue”

The second half of this rule refers to “up to 1 item” means that only one blue item will be discounted for every blue item purchased.

This rule is written for items that register their color in the “color” property of their SKU.

 

Buy three, get one free

This rule indicates that if a customer buys 3 items, they will receive one item free. If they buy 6 items, they will receive 2 items free, etc.

Create a “Item Discount – fixed price” promotion. Set the adjuster to Zero.

Create the following PMDL representation:

“For next 3 items whose SKU color is blue, discount up to 1 item whose SKU color is blue”

 

Buy three or more, get one free

This rule is a version of the “Buy 3, get 1 free” promotion that limits the promotion to one free item per order. For example, if you buy six items, you still just get one free item.

Create a “Item Discount – fixed price” promotion. Set the adjuster to Zero.

Create the following PMDL representation:

“When order contains at least 3 (product in category named clothing); Apply discount to up to 1 (product in category named clothing)”

Buy 13 of X for the price of 12 X’s

This rule could be rewritten as “for every 12 Xs that you buy, get 1 X free,” or more simply “buy 12, get one free.”

If X is “something blue,” Create a discount of type “Item Discount – fixed price,” and set its adjuster to zero.

Next, create the following PMDL rule:

“for next 12 items whose SKU’s color is blue, discount up to 1 item whose SKU’s color is blue”

 

Buy 2 of X, get the 3rd X for 20% off [or $20 off]

This example follows the same pattern as the above two examples, except that the applied discount is different. If X is something blue. Create a “Item Discount – percent off” promotion (or “Item Discount - amount off”). Set the adjuster to 20.

Next, create the following PMDL rule:

“for next 2 items whose SKU’s color is blue, discount up to 1 item whose SKU’s color is blue.”

 

Tier pricing: Buy the first 5 at $10 each, buy the next 5 at $5 each

This promotion can be created through a combination of two promotions. This is necessary because the promotion given is different based on the number of items bought.

In the following example, the item being purchased is “something blue.”

1) Create one “Item Discount - fixed price” promotion and set its adjuster to 10. Next, create the following PMDL rule:

“When order contains at most 5 (sku whose color is blue ), discount every ( sku whose color is blue )”

2) Create another “Item Discount - fixed price” promotion and set its adjuster to 5.

Next, create the following PMDL rule:

“When order contains at least 6 ( sku whose color is blue ) and order contains at most 10 ( sku whose color is blue ), discount every ( sku whose color is blue )”

 
Shipping Pricing Model Examples

The following table describes how to set up shipping pricing models using PMDL rules:

Free shipping

This promotion is written out in the form “under these conditions, give free shipping.” In the following example, the conditions are that there is at least one blue thing in the order.

Create a promotion of type “Shipping Discount – fixed price.” Set its adjuster to 0.

Next, create the following PMDL rule:

“when order contains at least 1 ( sku whose color is blue ), discount shipping group”

Upgraded shipping: Upgrade from regular 7-day shipping to next day shipping for the price of 7-day shipping.

This promotion is represented by a “fixed price” promotion. In the following example, the conditions for this promotion taking effect are that the order contains at least one SKU that’s blue.

Create a promotion of type “Shipping Discount – fixed price.” Set the adjuster to the price of seven-day shipping.

The rule ensures that you only discount next day air.

Next, create the following PMDL rule:

“when order contains at least 1 ( sku whose color is blue ) and Shipping Group’s shippingGroupType is ‘Next Day’ discount shipping group”

Order Pricing Model Examples

The following table describes how to set up Order pricing models using PMDL rules:

10% of the total price of the order

This rule requires a condition under which the Y% should be taken off. In the following example, the condition is that the order contains a blue item.

Create a new discount of type Order Discount – percent off. Set the adjuster to 10. Next, create the following PMDL rule:

“when order contains at least 1 ( sku whose color is blue ), discount order total.”

$10 off the total price of the order

This rule requires a condition under which the Y% should be taken off. In the following example, the condition is that the order contains a blue item.

Create a new discount of type Order Discount – amount off.

Set the discount percentage to 10. Next, create the following PMDL rule:

“when order contains at least 1 ( sku whose color is blue ), discount order total.”

10% off orders of $100 or more

This rule is an order discount based in the order’s priceInfo property. Create a new discount of type “Order Discount – Percent Off.”

“when Order’s priceInfo's amount is greater than 100, discount all items.

Free Y with the order

This rule is actually an Item Discount because it’s the Y that’s being described and Y’s price that is being discounted. In the following example, Y is a blue item.

Create a new promotion of type “item Discount - fixed price.” Set the adjuster to 0.

“when order contains at least 1 ( sku whose color is blue), discount up to 1 ( sku whose color is blue )”

Note that this will not automatically add the item to be discounted to the customer’s shopping cart. You must create a scenario to add the item to the cart. See the ATG Personalization Guide for Business Users for more information on scenarios.

 
loading table of contents...