Class OrderDiscountCalculation
This class is intended to be used internally by EPiServer. We do not support any backward compatibility on this.
Inherited Members
Namespace: EPiServer.Commerce.Marketing.Internal
Assembly: EPiServer.Business.Commerce.dll
Version: 14.26.0Syntax
public class OrderDiscountCalculation : PriceCalculationBase
Constructors
OrderDiscountCalculation()
Declaration
public OrderDiscountCalculation()
Methods
ApplyDiscount(IEnumerable<PriceEntry>, Decimal, Decimal)
Apply a money-off discount on the orders.
Declaration
public Decimal ApplyDiscount(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 per single unit. |
Returns
Type | Description |
---|---|
System.Decimal | The saved amount, 0 if no discount was applied. |
ApplyPercentage(IEnumerable<PriceEntry>, Decimal, Decimal)
Apply a percent-off discount on the entries.
Declaration
public Decimal ApplyPercentage(IEnumerable<PriceEntry> entries, Decimal totalAmount, Decimal percent)
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 | percent | The percentage for the discount. Note that this should be given in the 0 - 100 range, and not as a fractional value. |
Returns
Type | Description |
---|---|
System.Decimal | The saved amount, 0 if no discount was applied. |