The atg.commerce.pricing.QualifiedItem
class holds information about a CommerceItem
that qualifies for a discount. Each CommerceItem
is paired with a DiscountStructure
object, which contains discount information to apply.
Each QualifiedItem
contains a single DiscountStructure
to be applied to a quantity of a given CommerceItem
. If multiple discounts within a single promotion apply to a single CommerceItem
, multiple QualifiedItem
objects are returned. For example, a single item might qualify for two discounts within a single promotion, one for $10 off and a second for an additional $5 off. In that case, two QualfiedItem
objects are returned. (Note that this is a highly unusual case; the default behavior is to prevent a single item from receiving multiple discounts.)
Unlike a QualifiedItem
, a MatchingObject
can contain multiple discount structures. The usual purpose of PMDL containing multiple discount structures is to discount one set of items by one discount and a different set of items by the second discount. Note that the Oracle ATG Web Commerce Merchandising promotions user interface does not support assigning multiple discount structures in a single promotion; however, you can create custom templates that include this ability.
QualifiedItems
are returned from the Qualifier.findQualifyingItems
method. The QualifiedItem
class contains the following properties:
item
—TheCommerceItem
that qualified for a discount.qualifyingDetailsMap
—A map keyed by theDetailedItemPriceInfo
objects contained in theItemPriceInfo
object (which, in turn, is contained in theCommerceItem)
. The value for eachDetailedItemPriceInfo
object is a List of Range objects, which specifies the objects matched.For example, if a commerce item represents two T-shirts and has a single
DetailedItemPriceInfo
and a promotion applies to one of those T-shirts, the map would have one entry. The key would be theDetailedItemPriceInfo
and the value is aList
with a singleRange
entry. TheRange
in this case is [0,0]. If both T-shirts qualified, theRange
would be [0,1].