How to Output All Products of a Collection on a Products Page?

AppBuilder
Tourist
12 1 0

Creating a new product.liquid template to bundle products.

I want to output all products of a collection. The collection of products to be outputted is the same collection the product on the product page is on.

Example:

Collection: Tools

Product Page:

- Screwdriver (Part of Tools Collection)

- Output all other products in tools collection and allow to bundle add to cart.

This is on product.liquid custom template

 

 

  {% for collection in product.collections %}
    {% if collection.title == 'Tools' %}
      {{ collection.title }}
      {% for product in collection.products %}
        {{ product.title }}
      {% endfor %}
    {% endif %}
  {% endfor %}

 

 

collection.title works, but can't access other product data that is part of the same collection. Meaning product.title doesn't work.

0 Likes