Display more than 1 product in a blogpost without using an app

Hi all,

I am a Shopify beginner so I thought I would ask for help here :slightly_smiling_face:

I want to display products in my blogs/articles.

I have followed this tutorial and it worked well for me, however, it displays only one product even if I attach more than 1 tag in the blogpost.

{% 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 %}
      

---

      ### Products used in the article
      

      

{{blog_prod.title}}

      

{{blog_prod.price | money}}

      
    {% endif %}

Do you know what would be the best solution to display more than one product in 1 blogpost?

Thank you for your time!

Kind regards,

Zuzana

1 Like
  • You don’t have to get into all these codings.
  • Shopify has a feature called buy-button (Shopify’s own app). Install it.
  • You can create buy buttons for one product or multiple products easily on any page and embed them.
  • Here is a relevant help document from Shopify on how to do it