Pricing for fractional units is similar to the pricing described in the Core Commerce Pricing Services Overview section. As described in the DetailedItemPriceInfo section, the DetailedItemPriceInfo
gets a commerce item’s price and uses the quantityDerivedAsFloatingPoint
property to identify the quantity of commerce items the detailed price applies to. If the quantity
property is less than 0, the system uses the quantityWithFraction
property to identify how many commerce items the detailed price represents and returns the commerce item’s fractional quantity.
Unit price calculations with fractional quantities are performed by the PricingTools
using the unitPriceBean
class. Then the PricingTools
generates UnitPriceBean
objects that set a unit price based upon the DetailedItemPriceInfo
, the CommerceItem
and any additional price bean information, such as a group pricing model.
The DetailedItemPriceTools
identifies the fractional range using the LowBoundWithFraction
and HigBoundWithFraction
ranges. If the quantityWithFraction
property is used, it sets the setLowBoundWithFraction
and setHighBoundWithFraction
ranges. If the isFractionalRange
is set, it returns the range. If there is no PricingAdjustment
but the quantityWithFraction
is greater than 0, there’s a new pricingTool
adjustment amount. During the adjustment, the getQuantityDerivedAsFloatingPoint
method is called, creating the details for the entire quantity. For information on how ranges work, refer to the Relationship Types section.