Class PromotionEngineContentLoader
Gets and sorts available promotions and reference data used by the PromotionEngine.
Inheritance
Namespace: EPiServer.Commerce.Marketing.Internal
Assembly: EPiServer.Business.Commerce.dll
Version: 14.26.0Syntax
public class PromotionEngineContentLoader : Object
Constructors
PromotionEngineContentLoader(IContentLoader, CampaignInfoExtractor, IPriceService, ReferenceConverter, ISynchronizedObjectInstanceCache, MarketingOptions, IContentCacheKeyCreator)
Initializes a new instance of the PromotionEngineContentLoader class.
Declaration
public PromotionEngineContentLoader(IContentLoader contentLoader, CampaignInfoExtractor campaignInfoExtractor, IPriceService priceService, ReferenceConverter referenceConverter, ISynchronizedObjectInstanceCache objectInstanceCache, MarketingOptions marketingOptions, IContentCacheKeyCreator contentCacheKeyCreator)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.IContentLoader | contentLoader | Service used to load content data. |
CampaignInfoExtractor | campaignInfoExtractor | Used to extract informations about campaigns and promotions. |
IPriceService | priceService | The price service. |
ReferenceConverter | referenceConverter | The reference converter. |
EPiServer.Framework.Cache.ISynchronizedObjectInstanceCache | objectInstanceCache | The object instance cache. |
MarketingOptions | marketingOptions | The marketing options. |
EPiServer.Core.IContentCacheKeyCreator | contentCacheKeyCreator | The content cache key creator. |
PromotionEngineContentLoader(IContentLoader, CampaignInfoExtractor, IPriceService, ReferenceConverter, ISynchronizedObjectInstanceCache, MarketingOptions, IContentCacheKeyCreator, IHttpContextAccessor, ISiteDefinitionResolver, IRequestHostResolver, IContextModeResolver, IMarketService)
Initializes a new instance of the PromotionEngineContentLoader class.
Declaration
public PromotionEngineContentLoader(IContentLoader contentLoader, CampaignInfoExtractor campaignInfoExtractor, IPriceService priceService, ReferenceConverter referenceConverter, ISynchronizedObjectInstanceCache objectInstanceCache, MarketingOptions marketingOptions, IContentCacheKeyCreator contentCacheKeyCreator, IHttpContextAccessor httpContextAccessor, ISiteDefinitionResolver siteDefinitionResolver, IRequestHostResolver requestHostResolver, IContextModeResolver contextModeResolver, IMarketService marketService)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.IContentLoader | contentLoader | Service used to load content data. |
CampaignInfoExtractor | campaignInfoExtractor | Used to extract informations about campaigns and promotions. |
IPriceService | priceService | The price service. |
ReferenceConverter | referenceConverter | The reference converter. |
EPiServer.Framework.Cache.ISynchronizedObjectInstanceCache | objectInstanceCache | The object instance cache. |
MarketingOptions | marketingOptions | The marketing options. |
EPiServer.Core.IContentCacheKeyCreator | contentCacheKeyCreator | The content cache key creator. |
Microsoft.AspNetCore.Http.IHttpContextAccessor | httpContextAccessor | The http context accessor. |
EPiServer.Web.ISiteDefinitionResolver | siteDefinitionResolver | The site definition resolver |
EPiServer.Web.IRequestHostResolver | requestHostResolver | The rquest host resolver. |
EPiServer.Web.IContextModeResolver | contextModeResolver | Contect mode resolver |
IMarketService | marketService |
Methods
CreateInMemoryOrderGroup(ContentReference, IMarket, Currency)
Creates a new in-memory order group and adds a line item using the entryLink
.
Declaration
public virtual IOrderGroup CreateInMemoryOrderGroup(ContentReference entryLink, IMarket market, Currency marketCurrency)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Core.ContentReference | entryLink | The EPiServer.Core.ContentReference of the entry content to put in the order group. |
IMarket | market | The market to associate the order group with. |
Currency | marketCurrency | The market currency to use for the order group. |
Returns
Type | Description |
---|---|
IOrderGroup | Creates an InMemoryOrderGroup for a specific market and currency adding a
single ILineItem for the provided |
GetAppliedPromotions(IOrderGroup)
Gets the promotions applied to a IOrderGroup.
Declaration
public virtual IList<PromotionData> GetAppliedPromotions(IOrderGroup orderGroup)
Parameters
Type | Name | Description |
---|---|---|
IOrderGroup | orderGroup | The IOrderGroup for which to load promotions. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<PromotionData> | All PromotionData that have been applied to the IOrderGroup. |
GetCampaignFolderRoot()
Get the link to the campaign folder root.
Declaration
protected virtual ContentReference GetCampaignFolderRoot()
Returns
Type | Description |
---|---|
EPiServer.Core.ContentReference | The content link to the campaign folder root. |
GetEvaluablePromotionsInPriorityOrder(IMarket, IOrderGroup)
Gets the evaluable promotions in priority order.
Declaration
public virtual IList<PromotionData> GetEvaluablePromotionsInPriorityOrder(IMarket market, IOrderGroup orderGroup)
Parameters
Type | Name | Description |
---|---|---|
IMarket | market | The current market. |
IOrderGroup | orderGroup | The order group |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<PromotionData> | All valid promotions for a given market, sorted descending by priority. |
Remarks
Top priority first.
GetPromotions()
Gets all existing promotions.
Declaration
public virtual IEnumerable<PromotionData> GetPromotions()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PromotionData> | All PromotionData for all campaigns. |
GetPromotions(ContentReference)
Gets all existing promotions under a sales campaign.
Declaration
public virtual IEnumerable<PromotionData> GetPromotions(ContentReference campaignLink)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Core.ContentReference | campaignLink | The campaign link. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PromotionData> | All PromotionData for an especific campaign. |
GetPromotions(IEnumerable<ContentReference>)
Gets promotions from specific campaigns.
Declaration
public virtual IEnumerable<PromotionData> GetPromotions(IEnumerable<ContentReference> campaignLinks)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<EPiServer.Core.ContentReference> | campaignLinks | The campaign links. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PromotionData> | All PromotionData for specified campaigns. |
TryGetDefaultPriceAmount(String, MarketId, Currency, DateTime, out Decimal)
Gets the default price amount.
Declaration
protected virtual bool TryGetDefaultPriceAmount(string entryCode, MarketId marketId, Currency currency, DateTime validOn, out Decimal priceAmount)
Parameters
Type | Name | Description |
---|---|---|
System.String | entryCode | The entry code. |
MarketId | marketId | The market id. |
Currency | currency | The currency. |
System.DateTime | validOn | The valid date. |
System.Decimal | priceAmount | The output price amount. |
Returns
Type | Description |
---|---|
System.Boolean |
|