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

Class ShippingPromotionProcessorBase<TShippingPromotion>

Responsible for evaluating if a shipping promotion is valid for a specific IOrderForm.

Implements
Namespace: EPiServer.Commerce.Marketing
Assembly: EPiServer.Business.Commerce.dll
Version: 13.30.0
Syntax
public abstract class ShippingPromotionProcessorBase<TShippingPromotion> : PromotionProcessorBase<TShippingPromotion>, IPromotionProcessor where TShippingPromotion : ShippingPromotion
Type Parameters
Name Description
TShippingPromotion

Constructors

ShippingPromotionProcessorBase()

Declaration
protected ShippingPromotionProcessorBase()

Methods

CreateRedemptionDescription(IShipment, PromotionProcessorContext)

Creates a RedemptionDescription using affected shipment.

Declaration
protected virtual RedemptionDescription CreateRedemptionDescription(IShipment shipment, PromotionProcessorContext context)
Parameters
Type Name Description
IShipment shipment

The shipment.

PromotionProcessorContext context

The context for the promotion processor evaluation.

Returns
Type Description
RedemptionDescription

RedemptionDescription with AffectedShipments.

CreateRedemptionDescription(IEnumerable<IShipment>, PromotionProcessorContext)

Creates a RedemptionDescription using affected shipments.

Declaration
protected virtual RedemptionDescription CreateRedemptionDescription(IEnumerable<IShipment> shipments, PromotionProcessorContext context)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<IShipment> shipments

The shipments.

PromotionProcessorContext context

The context for the promotion processor evaluation.

Returns
Type Description
RedemptionDescription

RedemptionDescription with AffectedShipmentss.

CreateRewardDescription(TShippingPromotion, FulfillmentStatus, IEnumerable<RedemptionDescription>, PromotionProcessorContext)

Create the reward description which will be returned while evaluate if the promotion is fulfilled.

Declaration
protected abstract RewardDescription CreateRewardDescription(TShippingPromotion promotionData, FulfillmentStatus fulfillmentStatus, IEnumerable<RedemptionDescription> redemptions, PromotionProcessorContext context)
Parameters
Type Name Description
TShippingPromotion promotionData

The promotion data.

FulfillmentStatus fulfillmentStatus

The fulfillment status.

System.Collections.Generic.IEnumerable<RedemptionDescription> redemptions

The redemptions.

PromotionProcessorContext context

The context.

Returns
Type Description
RewardDescription

The reward for this promotion.

Evaluate(TShippingPromotion, PromotionProcessorContext)

Evaluates the shipping promotion.

Declaration
protected override RewardDescription Evaluate(TShippingPromotion promotionData, PromotionProcessorContext context)
Parameters
Type Name Description
TShippingPromotion promotionData

The promotion model.

PromotionProcessorContext context

The context for the promotion processor evaluation.

Returns
Type Description
RewardDescription

The reward for this promotion.

Overrides
EPiServer.Commerce.Marketing.PromotionProcessorBase<TShippingPromotion>.Evaluate(TShippingPromotion, EPiServer.Commerce.Marketing.PromotionProcessorContext)
Remarks

Note that this is an order level promotion we will always return ONE redemption.

GetFulfillmentStatus(TShippingPromotion, PromotionProcessorContext)

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

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

The promotion data.

PromotionProcessorContext context

The context.

Returns
Type Description
FulfillmentStatus

The calculated fulfillment status as a FulfillmentStatus value.

GetRedemptions(TShippingPromotion, IOrderForm, PromotionProcessorContext)

Gets list of RedemptionDescription that match shipping the promotion.

Declaration
protected virtual IEnumerable<RedemptionDescription> GetRedemptions(TShippingPromotion promotionData, IOrderForm orderForm, PromotionProcessorContext context)
Parameters
Type Name Description
TShippingPromotion promotionData

The shipping promotion data.

IOrderForm orderForm

The order form.

PromotionProcessorContext context

The context for the promotion processor evaluation.

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

GetShipments(IOrderForm, IEnumerable<Guid>)

Gets shipments that match the given shipping methods.

Declaration
protected static IEnumerable<IShipment> GetShipments(IOrderForm orderForm, IEnumerable<Guid> shippingMethods)
Parameters
Type Name Description
IOrderForm orderForm

The order form that contains the shipments to check.

System.Collections.Generic.IEnumerable<System.Guid> shippingMethods

The shipping methods to check for.

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

An IEnumerable of IShipment that uses the selected shipping methods.

Implements