Show related products on product pages
Related products are products that are similar to a selected product. You can display potential substitutes to help customers discover other similar products they might like. These products should appear in a You might also like section on the product page.
Adding the related products section to your product pages displays an automatically generated list of product recommendations.
In this tutorial, you'll learn how to show related products in your theme.
To implement product recommendations, you'll use the following:
Recommendation logicAnchor link to section titled "Recommendation logic"
The recommendation algorithm predicts the most relevant products based on the product that a customer is interacting with. The criteria that the algorithm uses depends on the merchant's online store. In general, it might take into account the following factors:
- Purchase history: Products that have historically been purchased together.
- Product description: Products with similar descriptions.
- Related collections: Products from collections that the current product is part of, excluding collections with handles
Recommendation algorithm criteriaAnchor link to section titled "Recommendation algorithm criteria"
The criteria that's used depends on a merchant's online store, and the recommendation intent. The following outlines which criteria is used, and when:
|Merchants with less than 7,000 products published to the online store, and an English storefront.|
|Purchase history only||
|Related collections||All merchants when purchase history and product description recommendations aren't available.|
The Shopify Search & Discovery app enables users to customize product recommendation and search results, which can impact results from storefront search and the Ajax Product Recommendations API. To learn about how these results can be impacted, visit the Shopify Help Center.
LimitationsAnchor link to section titled "Limitations"
The following list describes some limitations of the recommendation logic:
- The recommendation algorithm doesn't use orders that have been imported from another store or ecommerce platform to generate product recommendations.
- Products that are out of stock or set to a price of 0, gift cards, and products in the visitor's cart aren't included in recommendations.
UI guidelinesAnchor link to section titled "UI guidelines"
The following best practices can help to make sure that you're displaying recommended products in a way that improves the customer experience:
- The recommendation algorithm associates up to ten products with each product, in order of relevance. For example, the first recommended product is more relevant than the tenth recommended product. For this reason, it's a good idea to limit your recommendations to four products for each product page to promote only the most relevant recommendations.
- Make sure that you load the proper image size for the product card.
- Use phrases such as “You might also like” for the section header to explain to your customers why you're displaying the recommended products.
Implementing product recommendationsAnchor link to section titled "Implementing product recommendations"
In this implementation, the section content builds the general display by looping through each product returned through the
products attribute of the