You probably know that ATG Commerce offers a wide range of pricing features for eCommerce stores through its Pricing Services. How does it do it? The short answer is through Pricing Engines and Calculators.

Lets take a look at the following scheme in order to understand how they work and how the final subtotal is calculated.

How Oracle Commerce Pricing Works

 

1. All Pricing Engines load global promotions (ones that apply to all customers) on a regular basis. Each pricing Engine loads promotions of its type; i.e. an ItemPricingEngine – promotions for items, an OrderPricingEngines promotions for orders, etc.

2. Customers have a handle on the promotions that may apply to them on their profile – the activePromotions property. This includes promotions that may have been applied via targeters or scenarios.

3. When a customer creates a shopping cart (adds an item to the cart) an ItemPricingEngine loads item-level promotions for that particular customer.

4. An ItemPricingEngine determines the right Item Pricing method, of which there are 3:

Price Item Method. Items added to the cart at the same time will be priced as a single item.

E.g. A customer adds 5 shirts to the cart and then adds 3 more. An ItemPricingEngine will price them as 2 single items.

Price Each Item Method. Each item added to the cart will be priced as a single item by an ItemPricingEngine (regardless if all of them were added separately or at the same time).

E.g. A customer adds 5 shirts to the cart and then adds 3 more. An ItemPricingEngine will price them as 8 single items.

Price Items Method. All items that have been added to the cart at any time can be priced as a single item that allows ATG to apply such promotions as ‘buy X items and get free item/shipping or discount’.

E.g. A customer adds 5 shirts to the cart and then adds 3 more. An ItemPricingEngine will price them as 1 single item.

5. An ItemPricingEngine invokes ItemPricingCalculators that look up individual items’ prices in the catalog. There are 4 price lists that ItemPricingCalculators look up prices in:

Item Price List;

Item Price List Sale;

Configurable Item Price List;

Configurable Item Price List Sale.

There is a hierarchy of price lists that you can set up. Based on that hierarchy ItemPricingCalculators check the most prioritized list first and either return an initial item price to the engine or check the next prioritized list for the price (in case the price is not provided for the item in the previous list). The process ends when ItemPricingCalculators find the list containing an item price and returns it to the Engine.

6. An ItemPricingEngine uses a helper method in the Qualifier class to determine what (if anything), when and how can be discounted.

7. An ItemPricingEngine invokes appropriate ItemPricingCalculators that apply promotions and return updated item prices.

8. An OrderPricingEngine loads order-level promotions for the customer.

9. An OrderPricingEngine invokes OrderPricingCalculators that calculate the initial order’s subtotal by summing up items’ prices.

10. An OrderPricingEngine uses a helper method in the Qualifier class to determine whether any order-level promotion is applicable and, if so, how the order can be discounted.

11. An OrderPricingEngine invokes OrderPricingCalculators that apply promotions and return an updated order subtotal.

12. A ShippingPricingEngine loads shipping-level promotions for the customer.

13. A ShippingPricingEngine determines the right shipping method based on the customer’s preferences. There are 3 standard shipping methods customers can choose from:

2 Day Shipping Method that has the same fixed shipping price for all orders.

Next Day Shipping Method that has the same fixed shipping price for all orders.

Ground Shipping Method determines price based on the order subtotal.

14. A ShippingPricingEngine invokes ShippingPricingCalculators that calculates shipping prices and returns an updated initial order subtotal.

15. A ShippingPricingEngine uses a helper method in the Qualifier class to determine whether any shipping-level promotion is applicable and, if so, how the order can be discounted.

16. A ShippingPricingEngine invokes ShippingPricingCalculators that apply promotions and return an updated order subtotal.

17. A TaxPricingEngine loads tax-level promotions for the customer. This is in reality rarely implemented.

18. A TaxPricingEngine invokes TaxPricingCalculators that determine how taxes should be calculated. By default taxes are $0. If ATG Commerce is integrated with any tax-calculating software (e.g. Cybersource or TaxWare) then TaxPricingCalculators determine taxes through that software and return an updated order subtotal that also includes taxes.

19. A TaxPricingEngine uses a helper method in the Qualifier class to determine whether any tax-level promotion is applicable and, if so, how the order can be discounted.

20. A TaxPricingEngine invokes TaxPricingCalculators that apply tax-level promotions and returns an updated order subtotal. This is the final price that the customer will have to pay to complete the check out process.

The information provided here is a generic explanation of how ATG Pricing Services work. If you need a more detailed explanation of this topic you can read the Oracle ATG Commerce official documentation that has been used as the basis for this post.