Created
July 31, 2012 11:14
-
-
Save Chrisedmo/3216281 to your computer and use it in GitHub Desktop.
Shopify: Filter by Vendor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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