docs
  1. Features
  2. Discovery
  3. Recommendations

Recommendations

A user looking at a product sees what else might interest them: an alternative to the exact item, a product that ranks well in its category, or something they looked at earlier. The Storefront Application V3 ships these as three product sliders on the product detail page. Two of them also come as CMS blocks for other pages.

Why it matters

Each slider answers a different question. Similar products answer "what else is like this", trending products answer "what ranks well in this category right now", and recently viewed products answer "what did I already look at".

Try it

Try it: Recommendations on a product detail page

Open a product detail page. The similar and trending sliders appear a moment after the page because they load separately. The recently viewed slider fills as you open more products.

Recording of recommendations on a product detail page

What's included

  • Similar products: Alternatives to the product the user is viewing, loaded from the Storefront API and shown in a slider below the product details. See Similar Products.
  • Rule-based recommendations: A ranked slider that needs no reference product, such as trending products in the category of the product on the detail page. Editors can also place a smart sorting slider on any CMS page. See Rule-Based Recommendations.
  • Recently viewed products: The products a user opened earlier, kept in the browser and shown to customers and users alike, whether signed in or not. See Recently Viewed Products.

What you can change

Configure

Theme

Extend

  • Override fetchSimilarProducts on RecommendationsService to filter, reorder or replace the similar products, see Similar Products.
  • Override fetchCategoryRecommendations on RecommendationsService to change how the trending slider queries the Storefront API, see Rule-Based Recommendations. You register your subclass in the recommendations slot of src/server/registries.ts.
  • Record views on other pages with addProductId from the useRecentlyViewedProducts composable, see Recently Viewed Products.