Class PriceModifier

java.lang.Object
com.broadleafcommerce.pricing.domain.PriceModifier
All Implemented Interfaces:
Serializable

public class PriceModifier extends Object implements Serializable

Whereas PriceData provides a specific price for a PriceableTarget, a price modifier performs an operation on a priceable field of the target such as adding 20% of the target's cost to calculate the price.

Several priceable fields are defined by default including basePrice, baseCost, standardPrice, salePrice, and contractPrice. BasePrice and baseCost are provided as part of PriceableTarget.priceableFields. The map key names are configurable by PriceableFieldProperties so that each implementor can use their own terminology. For instance, the basePrice could be called 'MSRP' or 'retailPrice'.

StandardPrice, salePrice, and contractPrice are derivative prices determined after a standard or sale price list has provided a specific price. That is to say, the standardPrice is usually an override or modification of the basePrice provided by a PriceableEntity. Likewise, the salePrice can be an override or modification of the standardPrice provided by a StandardPriceList, and a contractPrice can override or modify a salePrice provided by a SalePriceList. Consequently, a StandardPriceList's PriceModifier cannot modify a salePrice or contractPrice, neither can a SalePriceList's PriceModifier modify a contractPrice.

The modificationType determines whether the amount is added, subtracted, multiplied, or a some other operation to the fieldToModify. Default supported operations defined in PriceModificationType.

Author:
Nathan Moore (nathanmoore
See Also: