An ItemPriceCalculator class maintains all the functionality common to all the pricing schemes. The ItemPriceCalculator has the following important properties:

Also, see the Using Price Lists in Combination with SKU-Based Pricing section for properties related to that capability.

The public API exposed by this class includes:

  • getPricingScheme: returns the pricing scheme for the CommerceItem

  • priceItem: examines the allowed PricingSchemeNames HashMap. When a match is found, it will call the corresponding Calculator’s priceItem method. Otherwise, an exception is thrown to indicate that the pricing scheme is not found.

Three sub-calculators correspond to the three different pricing schemes. The three different schemes are calculating the list price of an item, calculating the price of an item using bulk pricing, and calculating the price of an item using tiered pricing. For more information on bulk and tiered pricing, see the Using Price Lists section.

All of these calculators implement the ItemSchemePriceCalculator, which only has a priceItem method.

  • ItemListPriceCalculator: Calls the getPrice method from the PriceListManager to retrieve the list price of the CommerceItem. It then multiplies the price by the quantity returned by the getQuantity method of CommerceItem to get the total price. The ItemPriceInfo will contain one DetailedItemPriceInfo for each ShippingGroupCommerceItemRelationship in the CommerceItem. This is because of the Range property in both ShipItemRels and DetailedItemPriceInfos.

  • ItemBulkPriceCalculator: Calls the getPrice method from the PriceListManager to retrieve the complex price for the CommerceItem. It will check each price level of that complex price based on the quantity of the CommerceItem to decide the correct unit price for the item. The ItemPriceInfo will contain one DetailedItemPriceInfo for each ShippingGroupCommerceItemRelationship.

  • ItemTierPriceCalculator: Calls the getPrice method from the PriceListManager to retrieve the complex price for the CommerceItem. It will check each price level of that complex price to decide which unit price is used for each tier. The ItemPriceInfo will might several DetailedItemPriceInfos to reflect different unit prices for each tier.


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

Legal Notices