Click or drag to resize
MultiBuyDiscountsEvaluator Class
Class handling application of multi buy discounts on set of cart items. Discounts are based on the most expensive products. Discounts are applied to cheapest products.
Inheritance Hierarchy
SystemObject
  CMS.EcommerceMultiBuyDiscountsEvaluator

Namespace: CMS.Ecommerce
Assembly: CMS.Ecommerce (in CMS.Ecommerce.dll) Version: 8.2.23
Syntax
C#
public class MultiBuyDiscountsEvaluator

The MultiBuyDiscountsEvaluator type exposes the following members.

Constructors
  NameDescription
Public methodMultiBuyDiscountsEvaluator
Creates a new instance of applicator for given cart items.
Top
Methods
  NameDescription
Protected methodApplyDiscount
Applies discount to given number of unit of given item using.
Protected methodCanBaseDiscountOn
Checks if given item can be used to fulfill discounts conditions.
Protected methodCanBeDiscounted
Checks if given item can be discounted using given discount.
Public methodEvaluateDiscounts
Evaluates given discounts and applies matching ones to corresponding cart items.
Protected methodFindItemsToBaseDiscountOn
Finds items satisfying given discounts conditions.
Protected methodFindItemsToBeDiscounted
Finds items to be discounted with given discount based on given items. Returns true when at least one item was found.
Protected methodGetUnusedNonFreeUnits
Returns the number of unit not used as base for any discount nor discounted.
Protected methodPrepareItemsForDiscount
Ensures that PrioritizedItems list is ready for application of given discount.
Protected methodRememberUsedItems
Remembers that given items in given number of units were used for given discount.
Protected methodReset
Resets evaluator to its initial state.
Top
Extension Methods
  NameDescription
Public Extension MethodAsValue
Converts object to a query value which can be used as a query parameter
(Defined by QueryExtensions.)
Public Extension MethodGetAPIString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodGetString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodToBoolean
Returns the boolean representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDateTime
Returns the DateTime representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDouble
Returns the double representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToGuid
Returns the Guid representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToInteger
Returns the integer representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToString
Returns the string representation of an object or default value if not.
(Defined by CoreExtensions.)
Top
Properties
  NameDescription
Public propertyApplicator
MultiBuy discounts applicator to be used for application of items.
Protected propertyPrioritizedItems
List of cart items currently processed by this applicator.
Protected propertySortedItems
Cart items sorted by price.
Top
See Also