Click or drag to resize
ProductDiscountSourceGetDiscounts Method
Returns groups of discounts for the specified sku and price.

Namespace: CMS.Ecommerce
Assembly: CMS.Ecommerce (in CMS.Ecommerce.dll) Version: 13.0.131
Syntax
C#
public virtual IEnumerable<DiscountCollection> GetDiscounts(
	SKUInfo sku,
	decimal standardPrice,
	PriceParameters priceParams
)

Parameters

sku
Type: CMS.EcommerceSKUInfo
The SKU object.
standardPrice
Type: SystemDecimal
The price of the sku.
priceParams
Type: CMS.EcommercePriceParameters
Other parameters.

Return Value

Type: IEnumerableDiscountCollection

Implements

IProductDiscountSourceGetDiscounts(SKUInfo, Decimal, PriceParameters)
Remarks
Override this method to change the order in which the product discounts are applied. The following code shows the default implementation.
public override IEnumerable<DiscountCollection> GetDiscounts(SKUInfo sku, decimal standardPrice, PriceParameters priceParams)
{
    var groups = new List<DiscountCollection>();

    AddCatalogDiscounts(groups, sku, priceParams);
    AddVolumeDiscounts(groups, sku, priceParams);

    return groups;
}
See Also