The recommendations object

The recommendations object provides product recommendations that are related to a given product, based on data from sales, product descriptions, and relations between products and collections. Product recommendations become more accurate over time as new orders and product data become available. To learn more about how product recommendations work, see Showing product recommendations on product pages.

The recommendations object returns products only if it's used in a theme section that's rendered through an HTTP request to <base_url>?section_id=<section_id>&product_id=<product_id>. section_id is the ID of the section where the recommendations object is being used, and product_id is the ID of the product you want to show recommended products for. To determine the base_url, use the routes.product_recommendations_url attribute. Using the routes object rather than a hardcoded URL ensures that the product recommendations load in the correct locale.

To learn how to implement the recommendations object, see Showing product recommendations with the Product Recommendations API section response.

The recommendations object has the following attributes: