vendor


For example, to make a list of links to each vendor in a shop, you can use this code: {% for product_vendor in shop.vendors %}
  • {{ product_vendor | link_to_vendor }}
  • {% endfor %} Or, to make a list of links to each product type in a collection, you can now do this: {% for product_type in collection.all_types %}
  • {{ product_type | link_to_type }}
  • {% endfor %} Previously to get the same information, you had to use an ugly workaround like this: {% assign vendor_list = '' %} {% for product in collections.all.all_products %} {% if vendor_list contains product.vendor %} {% else %}
  • {{ product.vendor }}
  • {% capture temp %}{{ vendor_list }}{{ product.vendor }}{% endcapture %} {% assign vendor_list = temp %} {% endif %} {% endfor %} The four variables that were added are shop.vendors shop.types collection.all_vendors collection.all_types