Try our conversational search powered by Generative AI!

Class GetItemDiscountProcessorBase<TEntryPromotion>

Base class for processors for promotions giving a discount off specific target items.

Implements
Namespace: EPiServer.Commerce.Marketing.Promotions
Assembly: EPiServer.Business.Commerce.dll
Version: 13.30.0
Syntax
public abstract class GetItemDiscountProcessorBase<TEntryPromotion> : EntryPromotionProcessorBase<TEntryPromotion>, IPromotionProcessor where TEntryPromotion : EntryPromotion
Type Parameters
Name Description
TEntryPromotion

Constructors

GetItemDiscountProcessorBase(CollectionTargetEvaluator, LocalizationService, Func<TEntryPromotion, DiscountItems>, Func<TEntryPromotion, MonetaryReward>, RedemptionDescriptionFactory)

Initializes a new instance of the GetItemDiscountProcessorBase<TEntryPromotion> class.

Declaration
protected GetItemDiscountProcessorBase(CollectionTargetEvaluator targetEvaluator, LocalizationService localizationService, Func<TEntryPromotion, DiscountItems> targetGetter, Func<TEntryPromotion, MonetaryReward> discountGetter, RedemptionDescriptionFactory redemptionDescriptionFactory)
Parameters
Type Name Description
CollectionTargetEvaluator targetEvaluator

The target evaluator.

EPiServer.Framework.Localization.LocalizationService localizationService

The localization service.

System.Func<TEntryPromotion, DiscountItems> targetGetter

Delegate to get the discount targets from the promotion.

System.Func<TEntryPromotion, MonetaryReward> discountGetter

Delegate to get the discount from the promotion.

RedemptionDescriptionFactory redemptionDescriptionFactory

Factory for creating RedemptionDescriptions.

Methods

CanBeFulfilled(TEntryPromotion, PromotionProcessorContext)

Checks that the order has lineitems and that the promotion has any target items and a discount amount in the order's currency.

Declaration
protected override bool CanBeFulfilled(TEntryPromotion promotion, PromotionProcessorContext context)
Parameters
Type Name Description
TEntryPromotion promotion

The promotion.

PromotionProcessorContext context

The context.

Returns
Type Description
System.Boolean

True if all conditions are met, otherwise false.

Overrides
EPiServer.Commerce.Marketing.PromotionProcessorBase<TEntryPromotion>.CanBeFulfilled(TEntryPromotion, EPiServer.Commerce.Marketing.PromotionProcessorContext)

Evaluate(TEntryPromotion, PromotionProcessorContext)

Declaration
protected override RewardDescription Evaluate(TEntryPromotion promotionData, PromotionProcessorContext context)
Parameters
Type Name Description
TEntryPromotion promotionData
PromotionProcessorContext context
Returns
Type Description
RewardDescription
Overrides
EPiServer.Commerce.Marketing.PromotionProcessorBase<TEntryPromotion>.Evaluate(TEntryPromotion, EPiServer.Commerce.Marketing.PromotionProcessorContext)

GetFulfillmentStatus(TEntryPromotion, PromotionProcessorContext)

Implements promotion specific logic for determining the fulfillment status of the promotion.

Declaration
protected abstract FulfillmentStatus GetFulfillmentStatus(TEntryPromotion promotionData, PromotionProcessorContext context)
Parameters
Type Name Description
TEntryPromotion promotionData

The promotion data.

PromotionProcessorContext context

The context.

Returns
Type Description
FulfillmentStatus

The calculated fulfillment status as a FulfillmentStatus value.

GetRedemptions(TEntryPromotion, PromotionProcessorContext, IEnumerable<String>)

Gets all AffectedEntriess affected by a given promotion.

Declaration
protected override IEnumerable<RedemptionDescription> GetRedemptions(TEntryPromotion promotionData, PromotionProcessorContext context, IEnumerable<string> applicableCodes)
Parameters
Type Name Description
TEntryPromotion promotionData

The promotion used to evaluate the product codes.

PromotionProcessorContext context

The context for the promotion processor evaluation.

System.Collections.Generic.IEnumerable<System.String> applicableCodes

A collection of product codes to be checked against a promotion.

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

A list of applicable RedemptionDescriptions.

Overrides
EPiServer.Commerce.Marketing.EntryPromotionProcessorBase<TEntryPromotion>.GetRedemptions(TEntryPromotion, EPiServer.Commerce.Marketing.PromotionProcessorContext, System.Collections.Generic.IEnumerable<System.String>)

NotFulfilledRewardDescription(TEntryPromotion, PromotionProcessorContext, FulfillmentStatus)

Declaration
protected override RewardDescription NotFulfilledRewardDescription(TEntryPromotion promotionData, PromotionProcessorContext context, FulfillmentStatus fulfillmentStatus)
Parameters
Type Name Description
TEntryPromotion promotionData
PromotionProcessorContext context
FulfillmentStatus fulfillmentStatus
Returns
Type Description
RewardDescription
Overrides
EPiServer.Commerce.Marketing.PromotionProcessorBase<TEntryPromotion>.NotFulfilledRewardDescription(TEntryPromotion, EPiServer.Commerce.Marketing.PromotionProcessorContext, EPiServer.Commerce.Marketing.FulfillmentStatus)

Implements