Each pricing engine calls a corresponding helper method in the Qualifier
class to determine the objects to which it should apply a discount. The Qualifier
determines whether anything qualifies for the discount and then figures out which pieces should receive the discount.
The Qualifier
determines which things should change and how they should be discounted; it does not modify the actual prices. The pricing engine passes the parameters that make up its pricing context to the qualifier, and goes through the result set returned by the qualifier, calling the correct calculator to discount each element as appropriate.
ItemPricingEngine
uses the qualifier’sfindQualifyingItems
method, which returns a Collection ofQualifiedItems
. EachQualifiedItem
maps aDetailedItemPriceInfo
to the list of Ranges that qualified for the discount. TheCommerceItem
containing theseDetailedItemPriceInfos
is also stored. For more information, see the QualifiedItem Class.OrderPricingEngine
uses the qualifier’sfindQualifyingOrder
method, which returns aMatchingObject
identifying theOrder
to discount.ShippingPricingEngine
uses the qualifier’sfindQualifyingShipping
method, which returns aMatchingObject
object identifying theShippingGroup
to discount.
Each method determines its result set by comparing the PMDL rule of a given promotion to the input item or items.
The doFilters()
method evaluates items in the qualifier and target rules. It takes an array of filter components, which act to disqualify items from the qualifier or target; see the Qualifier Properties section for descriptions of the filters.