Click or drag to resize
ECommerceHelperApplyDiscounts 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: 9.0.0
Syntax
C#
public static double ApplyDiscounts(
	double price,
	IEnumerable<IItemDiscount> discounts,
	Func<double, IItemDiscount, double> discountCalculator
)

Parameters

price
Type: SystemDouble
Price to calculate discount from.
discounts
Type: System.Collections.GenericIEnumerableIItemDiscount
Discounts to apply.
discountCalculator
Type: SystemFuncDouble, IItemDiscount, Double
Function getting discount base price and discount object. Calculates resulting discount value.

Return Value

Type: Double
See Also