How can I do a multiple filter product

YerayLg
Tourist
9 0 0

 

Hello, I'm trying to have multiple tag selector that you can filter if is round and red at the same time, but only one filter selector works. Anyone knows how can I do it ??

 <label>Shop by color</label>
      <select name="SortTags" id="SortTags"  >
      {% assign tags = 'Red, Green, Blue' | split: ',' %}
      <option value="/collections/{{ collection.handle }}">All</option>
      {% for t in tags %}
      {% assign tag = t | strip %}
      {% if current_tags contains tag %}
      <option value="{{ tag | handle }}" selected>{{ tag }}</option>
      {% elsif collection.all_tags contains tag %}
      <option value="/collections/{{ collection.handle }} / {{ tag | handle }}">{{ tag }}</option>
      {%endif%}
      {%endfor%}
    </select>

    
   <label>Shop by size</label>
    <select name="SortTags" id="SortTags" >
    {% assign tags = 'Round, square, geometric' | split: ',' %}
      <option value="/collections/{{ collection.handle }}">All</option>
      {% for t in tags %}
      {% assign tag = t | strip %}
      {% if current_tags contains tag %}
      <option value="{{ tag | handle }}" selected>{{ tag }}</option>
      {% elsif collection.all_tags contains tag %}     
      <option value="/collections/{{ collection.handle }} / {{ tag | handle }}">{{ tag }}</option>
      {% endif %}
      {% endfor %}
    </select>  
 
 
      <label>Shop by material</label>
    <select name="SortTags" id="SortTags" >
    {% assign tags = 'White, leopard, Satin' | split: ',' %}
      <option value="/collections/{{ collection.handle }}">All</option>
      {% for t in tags %}
      {% assign tag = t | strip %}
      {% if current_tags contains tag %}
      <option value="{{ tag | handle }}" selected>{{ tag }}</option>
      {% elsif collection.all_tags contains tag %}        
      <option value="/collections/{{ collection.handle }} / {{ tag | handle }}">{{ tag }}</option>
      {% endif %}
      {% endfor %}
    </select>

Thanks for all.

0 Likes