How can I get recommendations from multiple products?

Topic summary

Goal: Display a single set of product recommendations in the cart by combining recommendations from all products currently in the cart.

Current behavior: The product recommendations endpoint appears to accept only one product_id. When multiple product_id parameters are added to data-url, the recommendations are generated only for the last product ID in the query.

Attempt: Modified product-recommendations data-url to iterate over cart items and append &product_id={{ item.product.id }} for each item. Result still yields recommendations from only the final item.

Proposed enhancement: Support querying multiple products at once, e.g., ~/recommendations/products?section_id=abc&limit=4&intent=related&product_ids=123,456,789, then merge and display combined results in the cart.

Artifacts: Code snippets (Liquid/markup) are central to understanding the issue and proposed solution.

Status: No confirmed workaround or official support indicated. This remains an open request/feature suggestion to enable multi-product recommendations aggregation.

Summarized with AI on December 19. AI used: gpt-5.

Hello,

is there a way to concact or get recommendations from multiple products?

I try to modify data-url like this, but he get recommendations only from last item.product.id

  <product-recommendations
    class="related-products page-width"
   data-url="{{ routes.product_recommendations_url }}?section_id={{ section.id }}{% for item in cart.items %}&product_id={{item.product.id}}{% endfor %}&limit={{ section.settings.products_to_show }}"
  >   

Any ideas?

Hello @kaiyaa ,

no, I want to show multiple recom in the cart. So take all the recom from the product in the cart and merge into one

@Shopify_77 , is there anyone watching this request? It would be helpful for showing combination recommendations for all products in the cart.

I reckon something like this would work great:

~/recommendations/products?section_id=abc&limit=4&intent=related&product_ids=123,456,789
2 Likes