Class PriceCalculationBase
This class is intended to be used internally by EPiServer. We do not support any backward compatibility on this.
Namespace: EPiServer.Commerce.Marketing.Internal
Assembly: EPiServer.Business.Commerce.dll
Version: 14.26.0Syntax
public abstract class PriceCalculationBase : Object
Constructors
PriceCalculationBase()
Declaration
protected PriceCalculationBase()
Methods
ApplyDiscount(IEnumerable<PriceEntry>, Decimal, Func<PriceEntry, Decimal>)
Apply a discount across all entries.
Declaration
protected Decimal ApplyDiscount(IEnumerable<PriceEntry> entries, Decimal totalAmount, Func<PriceEntry, Decimal> getDiscountedPriceFunc)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<PriceEntry> | entries | The entries to be discounted. |
System.Decimal | totalAmount | The initial total cost of the entries. |
System.Func<PriceEntry, System.Decimal> | getDiscountedPriceFunc | The function that calculates the price of an entry after discount. |
Returns
Type | Description |
---|---|
System.Decimal | The saved amount, 0 if no discount was applied. |
ApplyDiscountProportionally(IEnumerable<PriceEntry>, Decimal, Decimal)
Apply a fixed money-off discount across all the entries.
Declaration
protected Decimal ApplyDiscountProportionally(IEnumerable<PriceEntry> entries, Decimal totalAmount, Decimal discountAmount)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<PriceEntry> | entries | The entries to be discounted. |
System.Decimal | totalAmount | The initial total cost of the entries. |
System.Decimal | discountAmount | The amount to discount across all entries. |
Returns
Type | Description |
---|---|
System.Decimal | The saved amount, 0 if no discount was applied. |