Skip to content

Instantly share code, notes, and snippets.

@Chrisedmo
Created July 31, 2012 11:14
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save Chrisedmo/3216281 to your computer and use it in GitHub Desktop.
Save Chrisedmo/3216281 to your computer and use it in GitHub Desktop.
Shopify: Filter by Vendor
<!-- add the vendor as product tag to product then use this code in collection.liquid -->
<!-- if we are on a collection page that is either custom or smart -->
{% if collection.url != blank %}
<h4>Shop by vendor:</h4>
<ul>
{% for product_vendor in collection.all_vendors %}
<li>
{% if current_tags contains product_vendor %}
<a class="active" href="{{ collection.url }}">{{ product_vendor }}</a>
{% else %}
<a href="{{ collection.url }}/{{ product_vendor | handle }}">{{ product_vendor }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment