We sometimes run into simple custom Shopify features that aren’t well documented online.

One being the ability to Filter by Vendor or brand on a certain Collections page.

A collection of products is always located at the URL yourshop.com/collections/collection-name. (For e-commerce developers not familiar with Shopify, a collection is a product category such as Men, Women, Accessories, etc.) The standard Shopify templates and Themes don’t have the ability to filter collections by “Brand or Vendor”.  Deep in the shopify liquid cheat sheet we found that you can add this code to your collections.liquid theme file.

<ul>
{% for product_vendor in collection.all_vendors %}
<li class=”{{ product_vendor | handleize }}”>
{{ product_vendor | link_to_vendor }}
</li>
{% endfor %}
</ul>

Note* the “| handleize” portion of the code turns the spaces in a vendor into dashes. (Nike Plus, would be turned into nike-plus)

This code will spit out an unordered list of Vendors that exist within the collection you are viewing.
Examples: Link 1Link 2Link 3

What we’ve seen is that the vendor links goes directly to the the /collections/vendors?q=VendorName. This means that the same code above, will then be a dropdown for EVERY SINGLE vendor in you store. For small stores this isn’t an issues, but for larger stores with hundreds of Vendors/Brands you’re going to get a dropdown list of about 100+ brands. To avoid this, we recommend that you make separate template for each collection. collections.sounds.liquid, collection.gear.liquid, etc. Then on your main collections.liquid template, make the 3 separate filters with the code below for each collection. (replace “sounds” in the code below, to the name of your collection.)

<ul>
{% for product_vendor in collections.sounds.all_vendors %}
<li class=”{{ product_vendor | handleize }}”>
{{ product_vendor | link_to_vendor }}
</li>
{% endfor %}
</ul>

In short, drop the first code in your collections.liquid theme file to be able to filter by vendor. If you’d like to spit out a certain collections vendor list, past the second section of code in your collections.liquid file and append the “sounds” to the collection of your choice. Or you can always give us a call and see what we can do for you.