Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72473

Shopify Filter Collection by Size Variant

$
0
0

I'm currently using shopify's theme mr. parker, and it has a filtering by tags snippet. I'm trying to re-purpose this filter collections by tags snippet to instead filter by the product size variant. So how it currently works is that the snippet will look at the product's tags and will the filter tags options from the themes collection admin menu and show it as a filter drop down on the collections page. It works great for tags, but now I want it to filter by the product variant's size instead.

{% if settings.sort-dropdown-a-check %}
<li class="clearfix filter">
{% assign tags = settings.sort_a  | replace: ' ,', ',' | replace: ', ', ',' | split: ','%}     
<p>{{ settings.sort-a }}</p>
<select class="styled-select coll-filter">
  <option value="">All</option>
  {% for tag in tags %}
  {% if current_tags contains tag %}
  <option value="{{ tag | handle }}" selected>{{ tag }}</option>
  {% elsif collection.all_tags contains tag %}
  <option value="{{ tag | handle }}">{{ tag }}</option>
  {% endif %}
  {% endfor %}
</select>
</li>
{% endif %}

Thanks, for looking.


Viewing all articles
Browse latest Browse all 72473

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>