Support multiple prices per product

This is for:

Developer

It’s important to understand that Coveo can filter on product data from other related objects.

Dynamic pricing occurs in commerce catalogs with multiple dimensions, where an availability will determine who has access to an item, and at what price. Products and variants can be present in multiple availability items (stores or buyer groups). This can happen in B2C, and more commonly B2B scenarios.

In the following scenario, we will consider a 2-dimensional pricing structure that contains products and availabilities.

Example scenario

Your business sells office supplies to 500 retailers. Each retailer will have a specific price for each product. When a client performs a query, they should only be able to see a specific price for the product at a given location.

In a commerce environment, you would commonly see a 3-dimensional relationship between a product, its variants, and their availabilities. To simplify, we will ignore the product-variant relationship, and consider both catalog objects as a product that will vary depending on the catalog level.

Solution 1: Average price

You have a list of products and each have an average price. The average price will be used for sorting and facets, while the exact price will be shown to the user. You fetch the correct price from the Commerce platform when the page renders.

Average Price Example
Pros Cons
  • Simple to implement.

  • Works well if you have a small variation in price.

  • Possible lag to get the actual price to appear.

  • Additional logic required at indexing time to calculate the average price.

  • If the price variation is large, this can create confusion.

Solution 2: Dictionary field on the product

Adding a dictionary field on the Product object that contains the key (availabilityid) with value (price).

Dictionary on Product Example
Pros Cons
  • Always displays the exact price for the product.

  • The facets created for sorting the product will be precise.

  • Only the price for the current availability is returned in the payload.

  • No query lag as the price to display is extracted from the dictionary.

  • You’ll need to index your price information as a dictionary field. In other words, in your data structure, you’ll need to have your price information at the product level.