November Happy Hour will be moved to Thursday December 5th.

Class IPromotionEngineExtensions

Extension methods for IPromotionEngine.

Inheritance
System.Object
IPromotionEngineExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Commerce.Marketing
Assembly: EPiServer.Business.Commerce.dll
Version: 13.30.0
Syntax
public static class IPromotionEngineExtensions

Methods

Evaluate(IPromotionEngine, ContentReference)

Gets the information about all promotions related to an entry for the current market and default currency of the market.

Declaration
public static IEnumerable<RewardDescription> Evaluate(this IPromotionEngine promotionEngine, ContentReference entryLink)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

EPiServer.Core.ContentReference entryLink

The entry to get promotion information about.

Returns
Type Description
System.Collections.Generic.IEnumerable<RewardDescription>

A list of RewardDescription giving us the reward information associated to the entryLink.

Evaluate(IPromotionEngine, ContentReference, ICurrentMarket)

Gets the information about all promotions related to an entry for the current market and default currency of the market.

Declaration
public static IEnumerable<RewardDescription> Evaluate(this IPromotionEngine promotionEngine, ContentReference entryLink, ICurrentMarket currentMarket)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

EPiServer.Core.ContentReference entryLink

The entry to get promotion information about.

ICurrentMarket currentMarket

The current market.

Returns
Type Description
System.Collections.Generic.IEnumerable<RewardDescription>

A list of RewardDescription giving us the reward information associated to the entryLink.

Evaluate(IPromotionEngine, ContentReference, IMarket, Currency)

Gets the information about all promotions related to an entry.

Declaration
public static IEnumerable<RewardDescription> Evaluate(this IPromotionEngine promotionEngine, ContentReference entryLink, IMarket market, Currency currency)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

EPiServer.Core.ContentReference entryLink

The entry to get promotion information about.

IMarket market

The market.

Currency currency

The currency.

Returns
Type Description
System.Collections.Generic.IEnumerable<RewardDescription>

A list of RewardDescription giving us the reward information associated to the entryLink.

Evaluate(IPromotionEngine, ContentReference, IMarket, Currency, RequestFulfillmentStatus)

Gets the information about all promotions related to an entry.

Declaration
public static IEnumerable<RewardDescription> Evaluate(this IPromotionEngine promotionEngine, ContentReference entryLink, IMarket market, Currency currency, RequestFulfillmentStatus requestFulfillmentStatus)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

EPiServer.Core.ContentReference entryLink

The entry to get promotion information about.

IMarket market

The market.

Currency currency

The currency.

RequestFulfillmentStatus requestFulfillmentStatus

The request fulfillment status.

Returns
Type Description
System.Collections.Generic.IEnumerable<RewardDescription>

A list of RewardDescription giving us the reward information associated to the entryLink.

Evaluate(IPromotionEngine, IEnumerable<ContentReference>)

Gets the information about all promotions related to multiple entries for the current market and default currency of the market.

Declaration
public static IEnumerable<RewardDescription> Evaluate(this IPromotionEngine promotionEngine, IEnumerable<ContentReference> entryLinks)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

System.Collections.Generic.IEnumerable<EPiServer.Core.ContentReference> entryLinks

The entries to get the promotion information about.

Returns
Type Description
System.Collections.Generic.IEnumerable<RewardDescription>

A list of RewardDescription giving us the reward information associated to each of the entryLinks.

Evaluate(IPromotionEngine, IEnumerable<ContentReference>, ICurrentMarket)

Gets the information about all promotions related to multiple entries for the current market and default currency of the market.

Declaration
public static IEnumerable<RewardDescription> Evaluate(this IPromotionEngine promotionEngine, IEnumerable<ContentReference> entryLinks, ICurrentMarket currentMarket)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

System.Collections.Generic.IEnumerable<EPiServer.Core.ContentReference> entryLinks

The entries to get the promotion information about.

ICurrentMarket currentMarket

The current market.

Returns
Type Description
System.Collections.Generic.IEnumerable<RewardDescription>

A list of RewardDescription giving us the reward information associated to each of the entryLinks.

Evaluate(IPromotionEngine, IEnumerable<ContentReference>, IMarket, Currency, RequestFulfillmentStatus)

Gets the information about all promotions related to multiple entries.

Declaration
public static IEnumerable<RewardDescription> Evaluate(this IPromotionEngine promotionEngine, IEnumerable<ContentReference> entryLinks, IMarket market, Currency currency, RequestFulfillmentStatus requestFulfillmentStatus)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

System.Collections.Generic.IEnumerable<EPiServer.Core.ContentReference> entryLinks

The entries to get the promotion information about.

IMarket market

The current market.

Currency currency

The currency.

RequestFulfillmentStatus requestFulfillmentStatus

The request fulfillment status.

Returns
Type Description
System.Collections.Generic.IEnumerable<RewardDescription>

A list of RewardDescription giving us the reward information associated to each of the entryLinks.

GetDiscountPrices(IPromotionEngine, ContentReference, IMarket)

Gets all applicable EntryPromotions along with the price for the entry if the promotion should be applied to it for the specified market and the default currency for that market.

Declaration
public static IEnumerable<DiscountedEntry> GetDiscountPrices(this IPromotionEngine promotionEngine, ContentReference entryLink, IMarket market)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

EPiServer.Core.ContentReference entryLink

EPiServer.Core.ContentReference to the product or variant entry to evaluate.

IMarket market

The market to be considered when evaluating promotions.

Returns
Type Description
System.Collections.Generic.IEnumerable<DiscountedEntry>

A collection of discounted entries with related promotions and prices.

GetDiscountPrices(IPromotionEngine, ContentReference, IMarket, Currency)

Gets all applicable EntryPromotions along with the price for the entry if the promotion should be applied to it for the specified market and currency.

Declaration
public static IEnumerable<DiscountedEntry> GetDiscountPrices(this IPromotionEngine promotionEngine, ContentReference entryLink, IMarket market, Currency currency)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

EPiServer.Core.ContentReference entryLink

EPiServer.Core.ContentReference to the product or variant entry to evaluate.

IMarket market

The market to be considered when evaluating promotions.

Currency currency

The currency.

Returns
Type Description
System.Collections.Generic.IEnumerable<DiscountedEntry>

A collection of discounted entries with related promotions and prices.

GetDiscountPrices(IPromotionEngine, IEnumerable<ContentReference>, IMarket, Currency)

Gets all applicable EntryPromotions along with the price if the promotion should be applied for each provided entry in entryLinks.

Declaration
public static IEnumerable<DiscountedEntry> GetDiscountPrices(this IPromotionEngine promotionEngine, IEnumerable<ContentReference> entryLinks, IMarket market, Currency marketCurrency)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

System.Collections.Generic.IEnumerable<EPiServer.Core.ContentReference> entryLinks

A collection of EPiServer.Core.ContentReferences to products or variant entries to evaluate.

IMarket market

The market to be considered when evaluating promotions.

Currency marketCurrency

The currency used for calculating prices.

Returns
Type Description
System.Collections.Generic.IEnumerable<DiscountedEntry>

A collection of discounted entries with related promotions and prices.

Exceptions
Type Condition
System.ArgumentNullException

marketCurrency

GetDiscountPrices(IPromotionEngine, IEnumerable<ContentReference>, IMarket, Currency, ReferenceConverter, ILineItemCalculator)

Gets all applicable EntryPromotions along with the price if the promotion should be applied for each provided entry in entryLinks.

Declaration
public static IEnumerable<DiscountedEntry> GetDiscountPrices(this IPromotionEngine promotionEngine, IEnumerable<ContentReference> entryLinks, IMarket market, Currency marketCurrency, ReferenceConverter referenceConverter, ILineItemCalculator lineItemCalculator)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

System.Collections.Generic.IEnumerable<EPiServer.Core.ContentReference> entryLinks

A collection of EPiServer.Core.ContentReferences to products or variant entries to evaluate.

IMarket market

The market to be considered when evaluating promotions.

Currency marketCurrency

The currency used for calculating prices.

ReferenceConverter referenceConverter

The reference converter.

ILineItemCalculator lineItemCalculator

The line item calculator.

Returns
Type Description
System.Collections.Generic.IEnumerable<DiscountedEntry>

A collection of discounted entries with related promotions and prices.

Exceptions
Type Condition
System.ArgumentNullException

marketCurrency

GetPromotionItemsForCampaign(IPromotionEngine, ContentReference)

Gets the promotions and valid items for each promotion for campaign.

Declaration
public static IEnumerable<PromotionItems> GetPromotionItemsForCampaign(this IPromotionEngine promotionEngine, ContentReference campaign)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

EPiServer.Core.ContentReference campaign

The campaign.

Returns
Type Description
System.Collections.Generic.IEnumerable<PromotionItems>

Collection of promotions and the valid items for each promotion

GetPromotionItemsForCampaign(IPromotionEngine, IContentLoader, PromotionProcessorResolver, ContentReference)

Gets the promotions and valid items for each promotion for campaign.

Declaration
public static IEnumerable<PromotionItems> GetPromotionItemsForCampaign(this IPromotionEngine promotionEngine, IContentLoader contentLoader, PromotionProcessorResolver promotionProcessorResolver, ContentReference campaign)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

EPiServer.IContentLoader contentLoader

The content loader.

PromotionProcessorResolver promotionProcessorResolver

The promotion processor resolver.

EPiServer.Core.ContentReference campaign

The campaign.

Returns
Type Description
System.Collections.Generic.IEnumerable<PromotionItems>

Collection of promotions and the valid items for each promotion

Run(IPromotionEngine, IOrderGroup)

Checks the condition for all active promotions, and gives awards for the promotions where the condition has been fulfilled. Promotions with higher priority (lower Priority value) will be evaluated first and all excluded promotions will not be evaluated.

Declaration
public static IEnumerable<RewardDescription> Run(this IPromotionEngine promotionEngine, IOrderGroup orderGroup)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

IOrderGroup orderGroup

The order group which will receive rewards.

Returns
Type Description
System.Collections.Generic.IEnumerable<RewardDescription>
Remarks

Will return RewardDescriptions only for promotions that are fulfilled.

Run(IPromotionEngine, IOrderGroup, PromotionEngineSettings)

Checks the condition for all active promotions, and gives awards for the promotions where the condition has been fulfilled. Promotions with higher priority (lower Priority value) will be evaluated first and all excluded promotions will not be evaluated.

Declaration
public static IEnumerable<RewardDescription> Run(this IPromotionEngine promotionEngine, IOrderGroup orderGroup, PromotionEngineSettings promotionEngineSettings)
Parameters
Type Name Description
IPromotionEngine promotionEngine

The promotion engine.

IOrderGroup orderGroup

The order group which will receive rewards.

PromotionEngineSettings promotionEngineSettings

The settings for this run of the engine.

Returns
Type Description
System.Collections.Generic.IEnumerable<RewardDescription>
Remarks

Will return RewardDescriptions only for promotions that are match with RequestFulfillmentStatus setting.