This section provides an overview of the way ATG Commerce uses pricing services to calculate prices.

  1. A pricing engine is invoked from business-layer logic, such as a PriceItem servlet bean in a page or from the ATG Commerce PricingTools class. This usually occurs during checkout. (See PricingTools Class for more information.)

  2. The pricing engine applies its configured precalculators. A precalculator modifies a price without using any associated promotions. For example, a site could use a list price precalculator or an order subtotal precalculator to establish a base price to which subsequent calculators then apply a discount. All the precalculators (defined in ItemPricingEngine) are executed in order. This includes:

    • listPrice (fixed price, bulk price, tiered price)

    • salePrice (if item is on sale)

  3. The pricing engine accesses the current customer’s profile and retrieves any promotions listed in the activePromotions property of the profile. (You create promotions in the ATG Control Center. For more information, see Creating Promotions.)

    Note: The list of promotions that the business logic passes to the pricing engine often comes from the engine itself through its getPricingModels method. This method looks at the activePromotions property to find all promotions associated with a given profile.

  4. The pricing engine builds a list of global promotions (ones that you define as applying automatically to all customers). It builds the list by using its globalPromotionsQuery property to query the Promotions repository, searching for any promotion whose Automatically Give to All Customers (global) property is set to true.

  5. The resulting lists are concatenated. The pricing engine processes one at a time the objects for which it is tasked with generating a price. It applies promotions by priority.

    Note: You can also specify a priority level for any promotion by setting its Order of Application (priority) property in the Promotion repository. The pricing engine sorts the promotions by this property before it applies them.

    For each available promotion, ATG Commerce does the following:

  6. The pricing engine applies its configured PostCalculators, which make any necessary modifications to the price after any discounts have been applied.

  7. The pricing engine modifies the PriceInfo object of the object being discounted.

This process is repeated every time a price is requested.

loading table of contents...