I am working on displaying products on blog posts and have managed to get a single product to display.
Is there a way to get all products to display?
The code I’m using: (It looks at the tags in blog post, finds the one containing product_[product name] and displays it.
{%- liquid
for tag in article.tags
if tag contains "product_"
assign prod_handle = tag | split: "_"
assign blog_prod = all_products[prod_handle[1]]
endif
endfor
%}
{% if blog_prod %}
## Recommended solutions
{% include 'use-case-product-grid-item' %}
{% endif %}
If you want a way to display products in a blog post just using the normal blog editor, I made an app that lets you embed multiple products into your posts.