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: 10.8.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)

Creates a RedemptionDescription using affected shipment.

Declaration
[Obsolete("This method is no longer used. Use the overload with an additional PromotionProcessorContext instead. Will remain at least until August 2018.")]
protected virtual RedemptionDescription CreateRedemptionDescription(IShipment shipment)
Parameters
Type Name Description
IShipment shipment

The shipment.

Returns
Type Description
RedemptionDescription

RedemptionDescription with AffectedShipments.

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>)

Creates a RedemptionDescription using affected shipments.

Declaration
[Obsolete("This method is no longer used. Use the overload with an additional PromotionProcessorContext instead. Will remain at least until August 2018.")]
protected virtual RedemptionDescription CreateRedemptionDescription(IEnumerable<IShipment> shipments)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<IShipment> shipments

The shipments.

Returns
Type Description
RedemptionDescription

RedemptionDescription with AffectedShipmentss.

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)

Gets list of RedemptionDescription that match shipping the promotion.

Declaration
[Obsolete("This method is no longer used. Use the overload with an additional PromotionProcessorContext instead. Will remain at least until August 2018.")]
protected virtual IEnumerable<RedemptionDescription> GetRedemptions(TShippingPromotion promotionData, IOrderForm orderForm)
Parameters
Type Name Description
TShippingPromotion promotionData

The shipping promotion data.

IOrderForm orderForm

The order form.

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

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