Product recommendations in cart drawer not working without section id

Hi everyone,

I’m currently making a cart drawer snippet which is rendered directly in body. In this component i want to show a list of product recommendations from the products currently in the cart. The product recommendations only works when section id is given in the url. In this case HTML is returned. Without the section id you only get the data in JSON. How would you get HTML in this case (without section id)?

This works on other sections (in this case you would use the recommendations object):

{shopurl}/recommendations/products?section_id={{ section.id }}&product_id={{ product.id }}&limit=2

I tried to replace section.id with cart__drawer but the request returns an error:

{shopurl}/recommendations/products?section_id=“cart__drawer”&product_id={{ product.id }}&limit=2

I also tried to pass the section id from a section that renders this snippet component but section id is null.

I am currently using Dawn. Has anybody run into these kind of issues. Can somebody please help?