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

Class DiscountUpdater

Handles the final calculation and setting of discount amounts.

Inheritance
System.Object
DiscountUpdater
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Commerce.Marketing
Assembly: EPiServer.Business.Commerce.dll
Version: 13.30.0
Syntax
public class DiscountUpdater

Constructors

DiscountUpdater(PromotionProcessorContext, ILineItemCalculator, IReturnLineItemCalculator)

Creates an instance of DiscountUpdater.

Declaration
public DiscountUpdater(PromotionProcessorContext processorContext, ILineItemCalculator lineItemCalculator, IReturnLineItemCalculator returnLineItemCalculator)
Parameters
Type Name Description
PromotionProcessorContext processorContext

The context to pull data from (currency, order sub total etc).

ILineItemCalculator lineItemCalculator

The line item calculator to use when updating line item discounts.

IReturnLineItemCalculator returnLineItemCalculator

The return line item calculator to use when updating return line item discounts.

DiscountUpdater(Currency, ILineItemCalculator, IReturnLineItemCalculator)

Creates an instance of DiscountUpdater.

Declaration
[Obsolete("This constructor is no longer used, use the one with PromotionProcessorContext instead. Will remain at least until July 2019.")]
public DiscountUpdater(Currency currency, ILineItemCalculator lineItemCalculator, IReturnLineItemCalculator returnLineItemCalculator)
Parameters
Type Name Description
Currency currency

The currency to use in calculations.

ILineItemCalculator lineItemCalculator

The line item calculator to use when updating line item discounts.

IReturnLineItemCalculator returnLineItemCalculator

The return line item calculator to use when updating return line item discounts.

Methods

UpdateLineItemDiscount(IEnumerable<PriceEntry>)

Calculates discount amounts based on price entries and applies those to the corresponding line items.

Declaration
public void UpdateLineItemDiscount(IEnumerable<PriceEntry> prices)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<PriceEntry> prices

The price entries that describes the new price.

UpdateShippingDiscount(IEnumerable<ShipmentPrice>)

Calculates discount based on shipping prices and applies those to the corresponding shipments.

Declaration
public void UpdateShippingDiscount(IEnumerable<ShipmentPrice> prices)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<ShipmentPrice> prices

The shipping prices that describes the new price.

Remarks

Assumes that there will only be one ShipmentPrice per shipment, although this assumption is not verified nor enforced.