[How-to] Multiple Dropdown Sorting Boxes on Collection Pages (Brooklyn)

agururaj
New Member
6 0 0

Also once i choose an option on the filter, when I select ALL again the filter doesnt reset unless I refresh the page again. could you plz provide a solution for this issue

 

0 Likes
agururaj
New Member
6 0 0

update: the filter works after adding the code given by synapsen. Thank you

 


<script> /* Product Tag Filters - Good for any number of filters on any type of collection pages */

var collFilters = jQuery('.coll-filter');

collFilters.change(function() {

var newTags = [];

collFilters.each(function() {

if (jQuery(this).val()) {

newTags.push(jQuery(this).val()); } });

if (newTags.length) {

var query = newTags.join('+'); window.location.href = jQuery('{{ 'tag' | link_to_tag: 'tag' }}').attr('href').replace('/' + 'tag', '/' + query); }

else { {% if collection.handle %} window.location.href = '/collections/{{ collection.handle }}';

{% elsif collection.products.first.type == collection.title %} window.location.href = '{{ collection.title | url_for_type }}'; {% elsif collection.products.first.vendor == collection.title %} window.location.href = '{{ collection.title | url_for_vendor }}'; {% endif %} } }); </script>

 

 

but I need this filter to be displayed in only one of my collection and not all. Could some one plz help me to do tag filter for just one collection (specific collection)

0 Likes
lotteimglueck
Tourist
6 0 5

hi there, thank you for the code. It works great! However, I would like to change something about the border colors. When you move the cursor over the grids the color becomes grey or black (see pictures). Is it possible to have the color constantly black without changing border color? Where can I find the settings for the border colors?

Thanks in advance!

0 Likes
Val12
New Member
2 0 0

Hey,

I am also quite bad with liquid. 

Was wondering if you could share exactly which part of the code you used and how/where you adapted it to the theme.liquid.

Also what exact elements did you change to make it fit with the dropdown?

Thaaaanks!

 

Val

0 Likes
Val12
New Member
2 0 0

Hey,

 

Where exactly did you add this? A snip would be great if you can  

0 Likes