Try our conversational search powered by Generative AI!

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: 10.8.0
Syntax
public class DiscountUpdater

Constructors

DiscountUpdater(Currency, ILineItemCalculator)

Creates an instance of DiscountUpdater.

Declaration
public DiscountUpdater(Currency currency, ILineItemCalculator lineItemCalculator)
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.

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.