Order pricing in Commerce Reference Store is based on the Commerce pricing services described in the ATG Commerce Programming Guide. The process is managed by the /atg/commerce/pricing/PricingTools component, which calls the following pricing engines in the order listed:

  • /atg/commerce/pricing/ItemPricingEngine -- Determines the price for each item in the order.

  • /atg/commerce/pricing/OrderPricingEngine -- Determines the order subtotal, which includes the total price of all the items, but does not include shipping or taxes.

  • /atg/commerce/pricing/ShippingPricingEngine -- Determines the shipping price for each shipping group in the order.

  • /atg/commerce/pricing/TaxPricingEngine -- Determines the tax charges for the order.

Each pricing engine iterates through a set of precalculators to determine an initial price. It then applies any promotions of the corresponding type (i.e., item discount, order discount, or shipping discount) that have been granted to the customer. (See the Promotions chapter for information about the available promotions.) When one engine finishes its work, the next engine is called, until the total price is determined.

So, for example, if a customer has been granted a promotion for 10% off the order total, the OrderPricingEngine:

  1. Invokes /atg/commerce/pricing/calculators/OrdersSubtotalCalculator, which computes an initial subtotal by summing the prices (previously determined by ItemPricingEngine) of the items in the order.

  2. Applies the promotion, which reduces the order price by 10%.

PricingTools then invokes ShippingPricingEngine.

ItemPricingEngine

Commerce Reference Store configures ItemPricingEngine to use precalculators that look up prices in price lists:

precalculators=\
   calculators/ItemPriceListCalculator,\
   calculators/ItemPriceListSaleCalculator,\
   calculators/ConfigurableItemPriceListCalculator,\
   calculators/ConfigurableItemPriceListSaleCalculator
OrderPricingEngine

Commerce Reference Store uses OrderPricingEngine without any additional configuration.

ShippingPricingEngine

Commerce Reference Store configures ShippingPricingEngine to use three precalculators: /atg/commerce/pricing/shipping/Ground, /atg/commerce/pricing/shipping/TwoDay, and /atg/commerce/pricing/shipping/NextDay. The calculator applied to an individual shipping group is determined by the shipping method specified for that shipping group.

The TwoDay and NextDay calculators are fixed-price calculators (class atg.commerce.pricing.FixedPriceShippingCalculator), applying prices of $9.50 and $18.95 to the shipping group, respectively. The Ground calculator (class atg.commerce.pricing.PriceRangeShippingCalculator) determines the shipping price based on the total cost of the items in the shipping group. The shipping prices are set through the ranges property of the calculator:

ranges=00.00:14.99:4.75,\
       15.00:49.99:5.95,\
       50.00:MAX_VALUE:6.50

This setting means that if the total is $14.99 or less, shipping is $4.75; if the total is between $15.00 and 49.99, shipping is $5.95; and if the total is $50.00 or more, shipping is $6.50.

TaxPricingEngine

TaxPricingEngine is configured in Commerce to use /atg/commerce/pricing/calculators/TaxProcessorTaxCalculator as its precalculator. This component (of class atg.commerce.pricing.AddressVerificationTaxProcessorTaxCalculator), has a taxProcessor property that is set to the component that performs or manages the actual tax calculations.

By default, this property is set to /atg/commerce/payment/DummyTaxProcessor, which always returns $0.00. If you integrate your store with tax-calculating software, you can instead set taxProcessor to a component that makes calls to the tax-calculating software and processes the results.


Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved. Legal Notices