Three attributes manage promotions for each user:
activePromotions
: Stores the list of promotions that can be used by the user in pricing their orders.usedPromotions
: Stores any promotions used in an order.inactivePromotions
: Stores promotions that can no longer be used. A promotion would be moved into the inactive list if it was created with a limited number of uses and the user had reached the threshold.
Each of these collection attributes has a component item type of ‘promotion’ which is defined in the Product Catalog repository /atg/commerce/catalog/ProductCatalog
.
The session-scoped PricingModelHolder
component (/atg/commerce/pricing/UserPricingModels
) asks the item, shipping, tax and order pricing engines to retrieve what promotions should be available for pricing. Each pricing engine implements the atg.commerce.pricing.PricingEngine
interface, which defines the getPricingModels
method. The implementation of this method returns a combined collection of global and user promotions, which comes from the activePromotions
attribute.