A common configuration used on Commerce sites involves assigning a pair of price lists to each customer, with one price list containing the list prices for all SKUs in the catalog, and the other price list containing sale prices for the SKUs that are currently on sale (and empty values for SKUs that are not on sale). The customer profile’s priceList
property is set to the price list holding the list prices, and the profile’s salePriceList
property is set to the price list holding the sale prices.
When the application looks up the price of an individual SKU, the following logic is applied:
If the price list specified in the
salePriceList
property has a price for the SKU, use that price.If the price list specified in the
salePriceList
property does not have a price for the SKU, use the price from the price list specified in thepriceList
property.
In other words, use the sale price if there is one, and if there isn’t, use the list price. The resulting value is referred to as the active price.
The ATG-Endeca integration includes classes that support this configuration. These classes assume each customer is assigned a price list pair. There may be only one price list pair that is assigned to all customers, or there may be different price list pairs for each site in a multisite environment. For example, a multisite environment with multiple country stores might have a different price list pair for each country store, to handle different currency, catalogs, or pricing; the customer is assigned price lists based on the defaultListPriceList
and defaultSalePriceList
site properties.
When the ATG-Endeca integration generates records for a given SKU, various classes are used to retrieve the data associated with specific price list pairs:
The
PriceListPairVariantProducer
class produces a separate record for each price list pair.In each record, the
PriceListPairAccessor
class sets the value of theproduct.priceListPair
property to the price list pair the record applies to.In each record, the
ActivePriceAccessor
class sets the value of thesku.activePrice
property based on the price values in the price list pair.After the records are generated and indexed, the
PriceListPairFilterBuilder
is used during querying to construct a filter that returns only the records associated with the price list pair for the current customer.
Note that if your application uses only a single price list pair, the PriceListPairVariantProducer
and the PriceListPairFilterBuilder
are not needed and can be disabled. If your application assigns price lists based on criteria other than site, you may need to write alternative classes (e.g., a different variant producer) to implement price-handling logic.