An ItemPriceCalculator class maintains all the functionality common to all the pricing schemes. The ItemPriceCalculator has the following important properties:
PriceListManager: holds the reference toPriceListManagerPricingSchemeNames: holds the key/Value pair for each allowed pricing scheme and its corresponding Calculator.For example:
listPricecorresponds to thePriceListsListCalculatorbulkPricecorresponds to thePriceListsBulkCalculatortieredPricecorresponds to thePriceListsTieredCalculator
Also, see the Using Price Lists in Combination with SKU-Based Pricing section for properties related to that capability.
The major public API exposed by this class includes:
getPricingScheme: returns the pricing scheme for theCommerceItempriceItem: examines the allowedPricingSchemeNamesHashMap. When a match is found, it will call the corresponding Calculator’spriceItemmethod. 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 thegetPricemethod from thePriceListManagerto retrieve the list price of theCommerceItem. It then multiplies the price by the quantity returned by thegetQuantitymethod ofCommerceItemto get the total price. TheItemPriceInfowill contain oneDetailedItemPriceInfofor eachShippingGroupCommerceItemRelationshipin theCommerceItem. This is because of theRangeproperty in bothShipItemRelsandDetailedItemPriceInfos.ItemBulkPriceCalculator: Calls thegetPricemethod from thePriceListManagerto retrieve the complex price for theCommerceItem. It will check each price level of that complex price based on the quantity of theCommerceItemto decide the correct unit price for the item. TheItemPriceInfowill contain oneDetailedItemPriceInfofor eachShippingGroupCommerceItemRelationship.ItemTierPriceCalculator: Calls thegetPricemethod from thePriceListManagerto retrieve the complex price for theCommerceItem. It will check each price level of that complex price to decide which unit price is used for each tier. TheItemPriceInfowill might severalDetailedItemPriceInfosto reflect different unit prices for each tier.
Using ItemPriceInfo with Price Lists
One ItemPriceInfo class fits three different pricing schemes. Each calculator uses a different description for the PricingAdjustment added to the ItemPriceInfo.
The priceList property of ItemPriceInfo is set to the priceList that was actually used to calculate it. This is nullable since other calculators other than those mentioned here will not set this. The ItemPriceCalculator is responsible for setting this value.

