Class PromotionProcessorContext
Context object passed into promotion processors and reward applicators, which contains discount information about the affected items.
Inheritance
Inherited Members
Namespace: EPiServer.Commerce.Marketing
Assembly: EPiServer.Business.Commerce.dll
Version: 11.8.3Syntax
public class PromotionProcessorContext
Constructors
PromotionProcessorContext(IOrderGroup, IOrderForm, ILineItemCalculator, IOrderFormCalculator, IShippingCalculator)
Declaration
[Obsolete("This constructor is no longer used, use the one with IReturnLineItemCalculator instead. Will remain at least until July 2018.")]
public PromotionProcessorContext(IOrderGroup orderGroup, IOrderForm orderForm, ILineItemCalculator lineItemCalculator, IOrderFormCalculator orderFormCalculator, IShippingCalculator shippingCalculator)
Parameters
Type | Name | Description |
---|---|---|
IOrderGroup | orderGroup | |
IOrderForm | orderForm | |
ILineItemCalculator | lineItemCalculator | |
IOrderFormCalculator | orderFormCalculator | |
IShippingCalculator | shippingCalculator |
PromotionProcessorContext(IOrderGroup, IOrderForm, ILineItemCalculator, IReturnLineItemCalculator, IOrderFormCalculator, IShippingCalculator)
Creates an instance of a PromotionProcessorContext.
Declaration
public PromotionProcessorContext(IOrderGroup orderGroup, IOrderForm orderForm, ILineItemCalculator lineItemCalculator, IReturnLineItemCalculator returnLineItemCalculator, IOrderFormCalculator orderFormCalculator, IShippingCalculator shippingCalculator)
Parameters
Type | Name | Description |
---|---|---|
IOrderGroup | orderGroup | The order group that is evaluated. |
IOrderForm | orderForm | The order form. |
ILineItemCalculator | lineItemCalculator | The line item calculator |
IReturnLineItemCalculator | returnLineItemCalculator | The return line item calculator. |
IOrderFormCalculator | orderFormCalculator | The order form calculator. |
IShippingCalculator | shippingCalculator | The shipping calculator. |
PromotionProcessorContext(IOrderGroup, IOrderForm, ILineItemCalculator, IReturnLineItemCalculator, IOrderFormCalculator, IShippingCalculator, PromotionEngineContentLoader, ContentReference)
Creates an instance of a PromotionProcessorContext.
Declaration
public PromotionProcessorContext(IOrderGroup orderGroup, IOrderForm orderForm, ILineItemCalculator lineItemCalculator, IReturnLineItemCalculator returnLineItemCalculator, IOrderFormCalculator orderFormCalculator, IShippingCalculator shippingCalculator, PromotionEngineContentLoader promotionEngineContentLoader, ContentReference campaignRootLink)
Parameters
Type | Name | Description |
---|---|---|
IOrderGroup | orderGroup | The order group that is evaluated. |
IOrderForm | orderForm | The order form. |
ILineItemCalculator | lineItemCalculator | The line item calculator |
IReturnLineItemCalculator | returnLineItemCalculator | The return line item calculator. |
IOrderFormCalculator | orderFormCalculator | The order form calculator. |
IShippingCalculator | shippingCalculator | The shipping calculator. |
PromotionEngineContentLoader | promotionEngineContentLoader | The promotion engine content loader. |
EPiServer.Core.ContentReference | campaignRootLink | The campaign root link. |
Properties
CurrentOrderFormSubTotal
Gets the current order form sub total that the promotion engine is processing at the time. This is calculated before every promotion has been evaluated.
Declaration
public decimal CurrentOrderFormSubTotal { get; }
Property Value
Type | Description |
---|---|
System.Decimal |
EntryPrices
Gets the price matrix for entries. Used to get the current state of prices for the line items. May change as more promotions are applied.
Declaration
public OrderFormPriceMatrix EntryPrices { get; }
Property Value
Type | Description |
---|---|
OrderFormPriceMatrix |
OrderForm
Gets the order form.
Declaration
public IOrderForm OrderForm { get; }
Property Value
Type | Description |
---|---|
IOrderForm |
OrderGroup
Gets the order group.
Declaration
public IOrderGroup OrderGroup { get; }
Property Value
Type | Description |
---|---|
IOrderGroup |
ShipmentPrices
Gets the price matrix for shipments.
Declaration
public ShipmentPriceMatrix ShipmentPrices { get; }
Property Value
Type | Description |
---|---|
ShipmentPriceMatrix |
Methods
AddConditionalItems(ContentReference, IDictionary<String, Decimal>)
Adds all conditional SKU codes and their individual required quantities to the PromotionProcessorContext's ConditionItems.
Declaration
public void AddConditionalItems(ContentReference promotionLink, IDictionary<string, decimal> individualRequiredQuantities)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Core.ContentReference | promotionLink | The EPiServer.Core.ContentReference of the PromotionData having the |
System.Collections.Generic.IDictionary<System.String, System.Decimal> | individualRequiredQuantities | A collection of SKU codes and their required quantities to be purchased for |
AddConditionalItems(ContentReference, IEnumerable<String>, Decimal)
Adds all conditional SKU codes and the total required quantity to the PromotionProcessorContext's ConditionItems.
Declaration
public void AddConditionalItems(ContentReference promotionLink, IEnumerable<string> codes, decimal totalRequiredQuantity)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Core.ContentReference | promotionLink | The EPiServer.Core.ContentReference of the PromotionData having the |
System.Collections.Generic.IEnumerable<System.String> | codes | A collection of SKU codes making a promotion applicable for an OrderForm. |
System.Decimal | totalRequiredQuantity | The total quantity required to be purchased for |
Clone()
Clones the promotion processor context object.
Declaration
public virtual PromotionProcessorContext Clone()
Returns
Type | Description |
---|---|
PromotionProcessorContext | The cloned context object. |
UpdateDiscounts()
Update the discount information on the line items, and shipments, that were used to populate EntryPrices and ShipmentPrices.
Declaration
public virtual void UpdateDiscounts()