In this tutorial, you will learn how to apply a promotion to the Episerver Commerce basket using the new beta promotions engine. Running promotions is an essential part of most e-commerce stores. Enabling promotion codes can help businesses improve their sales funnels, so this is something you need to master 🔥🔥🔥

In order to run beta features within Episerver, you will need to enable explicitly enable it in configuration first. If you are unsure of how to do this, I recommend you read this tutorial. After enabling beta functionality you should get access to a new marketing tab within the Episerver Commerce manager:

Applying A Promotion To The Marketing Engine In Episerver Commerce 1

To create a new promotion, open the marketing tab from within Commerce manager and then create a new campaign:

Applying A Promotion To The Marketing Engine In Episerver Commerce

You can do this from the top left-hand corner of the page by clicking on the plus button (+):

Applying A Promotion To The Marketing Engine In Episerver Commerce 3

Create a new campaign and fill in the appropriate promotion details. If you want to add additional detail that is not available out of the box, you can create a custom campaign. You can do this by creating a class that extends from SalesCampaign. An example of how to extend a campaign can be seen below:

Creating a Discount

After we have created a campaign, it's time to create a discount. Click the top left (+) plus button again and click discount:

Applying A Promotion To The Marketing Engine In Episerver Commerce 4

Next, pick out the type of discount you want to use:

Applying A Promotion To The Marketing Engine In Episerver Commerce 5

The process to create a discount is exactly the same as creating a page or a block. Fill in the properties you care about:

Applying A Promotion To The Marketing Engine In Episerver Commerce 6

Activating The Campaign and promotion

Remember to enable the active checkbox on the campaign. If you do not activate the promotion, it will not be triggered when the promotion engine is run 🤪

Applying A Promotion To The Marketing Engine In Episerver Commerce 7

With the campaign and discounts created within Episerver, it's time to write some code to apply the discounts.:

Apply this code within your basket code, specifically in the additional line item and update line item methods! When this code is executed successfully, you should b able to hit a breakpoint in your promotions processors Evaluate() method. This is a handy debugging tip! If the breakpoint never gets hit something is wrong. Double-check the campaign and promotion are active AND have valid start and end dates 🤔


You now know how to create a campaign and a promotion within the Episerver Commerce Manager 💥. The process is very simple but there are a few hidden gotcha's you should be aware of. Happy Coding 🤘