---
title: Promotion engine
slug: commerce-connect-15/docs/promotion-engine
docTags: 
createdAt: 2026-07-30T20:34:41.000Z
---

## Promotion engine flow

![Diagram of the promotion engine flow in Commerce Connect 10–12, showing the sequence from cart submission through filter, evaluation, and reward application.](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/ikpAeORrbhBRsy1-Mitb1-20260723-164627.png)

Classes in this topic are available in the following namespace:

- `EPiServer.Commerce.Marketing`

## Calculate promotions

`PromotionEngine` evaluates the conditions of all active promotions and rewards specific orders when the conditions are fulfilled. The following example uses the promotion engine to calculate promotions through the order API:

```csharp
var cart = ServiceLocator.Current.GetInstance<IOrderRepository>().LoadOrCreateCart<Cart>(PrincipalInfo.CurrentPrincipal.GetContactId(), Cart.DefaultName);
    IEnumerable<RewardDescription> rewardDescriptions = ServiceLocator.Current.GetInstance<IPromotionEngine>().Run(cart);
```

## Get promotion prices

The following example gets discounted entries for the current market:

```csharp
var promotionEngine = ServiceLocator.Current.GetInstance<IPromotionEngine>();
var currentMarket = ServiceLocator.Current.GetInstance<ICurrentMarket>();
IEnumerable<DiscountedEntry> discountedEntries = promotionEngine.GetDiscountPrices(entryLink, currentMarket);
```

Get promotion prices for a collection of entries:

```csharp
var promotionEngine = ServiceLocator.Current.GetInstance<IPromotionEngine>();
var currentMarket = ServiceLocator.Current.GetInstance<ICurrentMarket>();
var market = currentMarket.GetCurrentMarket();
IEnumerable<DiscountedEntry> discountedEntries = promotionEngine.GetDiscountPrices(entryLinks, market, market.DefaultCurrency);
```

## Evaluate entries

The following example evaluates a single entry:

```csharp
IEnumerable<RewardDescription> rewardDescriptions = ServiceLocator.Current.GetInstance<IPromotionEngine>().Evaluate(entryLink);
```

The following example evaluates a collection of entries:

```csharp
IEnumerable<RewardDescription> rewardDescriptions = ServiceLocator.Current.GetInstance<IPromotionEngine>().Evaluate(entryLinks);
```

## Get promotions and items for campaign

The following example gets promotions and items for a campaign:

```csharp
IEnumerable<PromotionsItems> promotionItemsList = ServiceLocator.Current.GetInstance<IPromotionEngine>().GetPromotionItemsForCampaign(campaignLink);
```

## Calculate promotions using workflows

Run the promotion system with the workflow system (legacy) to calculate and remove promotions. Updated workflow activities use `EPiServer.Commerce.Marketing.IPromotionEngine` to make calculations and manipulate the cart.

The workflows use the promotion system by default. Use one of the following methods to disable it:

- Update `Configs\ecf.app.config`:

```xml
<Application defaultApplicationName="ECApplication">
  <Features>
    <add feature="WorkflowsVNext" 
         state="Disabled" 
         type="Mediachase.Commerce.Core.Features.WorkflowsVNext, Mediachase.Commerce" />
  </Features>
</Application>
```

- Use the `ServiceLocator`:

```csharp
var featureSwitch = ServiceLocator.Current.GetInstance<IFeatureSwitch>();
featureSwitch.Features.Add(new WorkflowsVNext());
featureSwitch.DisableFeature(WorkflowsVNext.FeatureWorkflowsVNext);
```

**Related blog post:** [Old promotion system is (already) dead, long live the new promotion system](https://world.optimizely.com/blogs/Quan-Mai/Dates/2018/3/old-promotion-system-is-dead-long-live-the-new-promotion-system-/)
