Class GetItemDiscountProcessorBase<TEntryPromotion>
Base class for processors for promotions giving a discount off specific target items.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Commerce.Marketing.Promotions
Assembly: EPiServer.Business.Commerce.dll
Version: 10.8.0Syntax
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>)
Initializes a new instance of the GetItemDiscountProcessorBase<TEntryPromotion> class.
Declaration
protected GetItemDiscountProcessorBase(CollectionTargetEvaluator targetEvaluator, LocalizationService localizationService, Func<TEntryPromotion, DiscountItems> targetGetter, Func<TEntryPromotion, MonetaryReward> discountGetter)
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. |
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
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
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 virtual 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 |
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 |