Shannon Gray
Jun 29, 2013
(0 votes)

EPiServer Commerce Promotion Examples

Sometimes the best way to learn how something works is to see some examples of how its used. Below are a number of promotion examples built in EPiServer Commerce (out of the box) that will illustrate how dynamic promotions work. Specifically, you’ll see how to customize the Build Your Own Discount promotion templates to create a wide array of discounts. They come in three flavors : Entry (for giving discounts on individuals SKUs, independent of the cart, like on a category landing page), Order (for cart discounts on the cart or items in the cart), and Shipping (for providing discounts on shipping charges). Here are the examples with some explanation.

One general note is that the promotion descriptions are in $ but aren’t specific to a currency (unless specifically noted).

For orders which contain more than $60 of a combination of one or more skus, give a free gift

[Order: Building Your Own Discount]


The ExtendedPrice of LineItems represents the total cost for a “row” in a cart. For example, if you are getting 3 bottles of wine at $10 each, your ExtendedPrice would be $30. CatalogEntryId is the code or ID associated with a SKU. This term is a little confusing because it is *not* the CatalogEntryId of the SKU. The hierarchy of the dynamic purchase conditions means that the condition looks for a combination of lineitems in the cart which match an ExtendedPrice sum of 60 and any combination of the SKUs that matched the CatalogEntryIDs separated by OR statements. If the ORs weren’t present, it would require all three SKUs to be present in the cart and have a total sum of extended prices more than $60.

Buy 3 or more of a combination of one or more skus, give $5 off for a particular sku for the month of May only. This is limited to the first two quantity of the particular sku.

[Order: Building Your Own Discount]


This essentially says : For any combination of SKUs with a total quantity of 3 and have any combination of the following SKU codes, give the following reward.

Buy more than $25 in an order, give 10% off and free shipping

This is really two promotions : an Order promotion and a Shipping promotion. If your promotion is complicated, consider breaking it into multiple promotions.

[Order: Building Your Own Discount]


[Shipping: Building Your Own Discount]


Notice this uses Subtotal. Subtotal is the total of all of the ExtendedPrice values in the cart. It doesn’t include shipping charges or taxes. Note that the exception with taxes is that, if taxes are included in the SKU prices, as they often are with VAT, the tax amount won’t be separated from the SKU price. The property Total is available to provide a discount against the the total of the order including shipping… but that isn’t usually the intent of the promotion.

Also notice that the shipping promotion accesses the cart subtotal a little differently than the Order promotion.

Buy either an decanter or a glass and get 2 free bottles of a particular wine.

[Order: Building Your Own Discount]


The CatalogEntryIds here are for decanters and glasses. This is in contrast with the next promotion..

Buy a decanter and at least two glasses, get a free bottle of wine

[Order: Building Your Own Discount]


In this case, the first conditions of the purchase condition contains two decanter SKU codes and the second OrderForm.LineItems conditions contain two wine glass SKU codes. When two conditions are stacked without an Or statement between (as they are here, OrderForm.LineItems with children on top of another OrderForm.LineItems), they are assumed to be AND.

Buy more than 10 items, get 20% off of all of the items in the cart

[Order: Building Your Own Discount]


Here,  the sum of the quantities is great than 10, meaning the total quantities of all of the lineitems. Gift items won’t be included in the count here.

Buy more than 20€ of an item, get 10% off of order

This allows you to target the discount to a particular currency.

[Order: Build Your Own Discount]


Note that this is for the cart, not items on a category page as they haven’t been associated with your cart – so BillingCurrency won’t be available for promotion discounts in the Entry : Build Your Own Discount.

Give $20 off anything in a category

[Entry: Build Your Own Discount]


This could be used with any type of Build Your Own Discount. It will also apply to SKUs in a category page/detail page.

Buy 3 items from one category or 1 from another (with a value great than $100), get $20 back

[Order: Build Your Own Discount]


Important note : When you specify a % or $ off whole order reward, the reward will be calculated as a discount off the subtotal, not total.

Buy an item worth more than $100, get free shipping

[Shipping : Build Your Own Discount]


One final note : make sure to double check your promotion settings. Not only is it easy to make errors, but often the dynamic controls are quirky and don’t record or save the values you’ve entered. Its always worthwhile re-opening a promotion after creation to confirm you set it and the application saved it properly.

Jun 29, 2013


Jul 1, 2013 09:38 AM

Great examples Shannon!

Jul 17, 2013 09:16 PM

"Buy either an decanter or a glass and get 2 free bottles of a particular wine." Really? That sounds like a sweet deal or some combo of cheap wine or expensive decanter/glass. I'm cheap. I want the free wine! ;) Nice blog!! Jul 17, 2013 11:27 PM

Thank you. Great Examples.

I have a promotion similar to 'Buy either an decanter or a glass and get 2 free bottles of a particular wine',
It is buy product X, entry promotion code 'freetrial', get gift of product Y (free first month). Everything works just like your example, but if product X is removed, the gift product is not.

Have you had any experience with gift type promotions not re-evaluating/reverting?

Shannon Gray
Shannon Gray Jul 19, 2013 04:15 AM

Hi Roscoe -

This is a recently reported bug that EPiServer support is currently looking into. I believe it has been reproduced by them, in which a hotfix should be created soon (I don't have an ETA). It *sounds* like a bug with the RemoveDiscountsActivity, which is used in the CartValidate and CarePrepare workflows. So you could either ask support for help/the hotfix or debug the issue with the downloadable workflow/activity code (available here for Commerce V1 R3 :

I hope that helps!
Shannon Jul 23, 2013 08:24 PM

Thanks, I will contact support.

Another interesting behavior, is that entry promotions are not applied to line items that are 'gifts'. I.e. if you add a product as a gift, then attempt to apply another discount or use it as a condition for another promotion, the line item is skipped/ignored. ( CalculateDiscountActivity.CalculateDiscounts() line 293ish)

Do you have any insight into why it was implemented this way?

Shannon Gray
Shannon Gray Jul 30, 2013 07:50 PM

That's by design. This is to avoid compounding promotions when free gifts are added. In other words, this is done to prevent the addition of a free gift to trigger another promotion, since the customer isn't paying for the free gift. You could modify that workflow code if that's not the intended functionality for your site.

Pauline Aug 5, 2013 02:13 AM

Thanks for these examples Shannon. Hoping you can help tie up a loose end while trying to execute a Free Gift promotion: Buy ANY of [CATEGORY], Get 1 [SKU] Free/Gift (using [Order: Building Your Own Discount] as the promo type).

Once a customer's purchase criteria has been met, AND they apply the promo/coupon code, the free gift item can appear in the cart in 2 ways.
1) They click Apply Code again and the free gift appears in the cart list
2) They click the Update Shopping Bag and the free gift appears in the cart list with the retail price crossed out and marked as $0.
With both scenarios, when I Proceed To Checkout, the free gift doesn't appear in the order summary - just the prerequisite items.
Have you come across this issue with the free gift not flowing through as part of the checkout list?

Please login to comment.
Latest blogs
IDX21323 - RequireNonce is true, Nonce was null

We have multiple clients configured with Azure Active Directory (Microsoft Entra) for requiring authentication when accessing their website. The...

David Drouin-Prince | Oct 1, 2023 | Syndicated blog

Minimum Detectable Effect in Optimizely Web Experimentation

Understanding Minimum Detectable Effect Minimum Detectable Effect (MDE) is a core statistical calculation in Optimizely Web Experimentation. In...

Matthew Dunn | Oct 1, 2023 | Syndicated blog

Configured Commerce - Introduction to Long-Term Support (LTS) Releases

First off, for those who have not had a chance to meet me yet, my name is John McCarroll, and I am the Technical Product Manager for the Optimizely...

John McCarroll | Sep 29, 2023

Auto-translate with OpenAI in Optimizely CMS

You can now auto-translate content using your favorite online AI service, inside the old trustworthy Episerver.Labs.LanguageManager!

Tomas Hensrud Gulla | Sep 29, 2023 | Syndicated blog

Vulnerability in CMS 12 shell module configuration

Introduction A potential security vulnerability has been identified in Optimizely CMS 12, triggered by a certain shell module configuration. To be...

Magnus Rahl | Sep 28, 2023

AI-Assistant: The 'Change Tone' Shortcut

The AI-Assistant for Optimizely is constantly evolving, adjusting, and transforming to meet your digital needs, providing a cutting-edge advantage...

Luc Gosso (MVP) | Sep 27, 2023 | Syndicated blog