The XHTML file produced for an item has meta tags for multiple properties containing pricing data (one property per price list). When a user issues a search request that includes a facet or constraint based on the price property created by the PriceListPropertyProvider, the search client must determine which price list is assigned to the customer issuing the query, and map the price property in the query to the index property for that price list.

To do this, it determines which user profile properties identify the assigned price lists, and checks the value of those properties to determine the price lists to use. It then creates a property mapping between the price property in the indexing definition file and the price properties in the index associated with those price lists.

When a search query is issued, the /atg/commerce/search/PriceListPropertyMapping component creates the property mapping dynamically, based on the user’s profile and other settings that you specify through the following properties of the component:

The PriceListPropertyMapping component stores the propertyMapping tag in its priceMapping property. To include the tag in the search request, link the propertyMappings property of the /atg/commerce/search/ProductCatalogParserOptions component to this property:

propertyMappings^=\
   /atg/commerce/search/PriceListPropertyMapping.priceMapping

For example, the property mapping might be:

<propertyMapping>
  price,childSKUs.price@pl90002,childSKUs.price@pl90004
</propertyMapping>

This maps the price property in the query to the childSKUs.price@pl90002 and childSKUs.price@pl90004 properties in the index. The index properties are listed in order of precedence. When the query is executed, ATG Search first looks for the childSKUs.price@pl90002 property for an item. If there is a property by that name, Search uses the value of that property. If there is no childSKUs.price@pl90002 property (which means that price list pl90002 does not have a price for the item), it uses the price from the childSKUs.price@pl90004 property. So for example, if pl90002 contains sale prices and pl90004 contains list prices, Search uses the sale price if there is one, and otherwise uses the list price.

Specifying a Default Price List

If a user is not assigned a price list, constraints and facets based on price will not work properly for that user. This is generally not an issue for actual site customers, who should all have price lists assigned to them in their profiles, but it may affect internal users testing the site.

You can specify a default price list for users who are not assigned price lists in their profiles. To do this, set the defaultPriceListId property of the PriceListPropertyMapping component to the price list ID of the price list you want to use as the default. For example:

defaultPriceListId=pl90002
 
loading table of contents...