Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Class DiscountUpdater

Handles the final calculation and setting of discount amounts.

Inheritance
System.Object
DiscountUpdater
Namespace: EPiServer.Commerce.Marketing
Assembly: EPiServer.Business.Commerce.dll
Version: 14.26.0
Syntax
public class DiscountUpdater : Object

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.

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.