Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Shannon Gray
Jun 29, 2013
  8104
(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]

image

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]

image

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]

image

[Shipping: Building Your Own Discount]

freeShipping

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]

image

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]

image

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]

clip_image001[4]

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]

clip_image002

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]

clip_image002[5]

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]

clip_image002[1]

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]

clip_image002[3]

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

Comments

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!!

rrush@alphazeta.com
rrush@alphazeta.com 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 : http://world.episerver.com/Download/Items/EPiServer-Commerce/EPiServer-Commerce-1-R3/EPiServer-Commerce-1-R3-Code-Sample-Package/).

I hope that helps!
Shannon

rrush@alphazeta.com
rrush@alphazeta.com 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
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
or
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
Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog