Click or drag to resize
ECommerceHelper.ApplyDiscounts Method
Applies given discounts to specified price. Reflects discounts ordering. Discount value is calculated using discountCalculator function.

Namespace: CMS.Ecommerce
Assembly: CMS.Ecommerce (in CMS.Ecommerce.dll) Version: 8.2.23
Syntax
C#
public static double ApplyDiscounts(
	double price,
	IEnumerable<IItemDiscount> discounts,
	Func<double, IItemDiscount, double> discountCalculator
)

Parameters

price
Type: System.Double
Price to calculate discount from.
discounts
Type: System.Collections.Generic.IEnumerable<IItemDiscount>
Discounts to apply.
discountCalculator
Type: System.Func<Double, IItemDiscount, Double>
Function getting discount base price and discount object. Calculates resulting discount value.

Return Value

Type: Double
See Also