I've implemented a filter by tag system on my collection pages, both on the 'live' store for my client, and on my development store. This had been working perfectly last week, but when I randomly check it today these filters take people to a 404 page.
It seems the filters aren't generating the right URL, in this case this is the result after choosing 'XL' from the dropdown:
http://test-store.myshopify.com/collections/knitwearxl
It puts the filter tag right after the collection name, without a + or any special syntax.
I keep detailed backups of my themes, and have tried plenty of earlier versions where this functionality worked for certain, both on my dev store and my clients (currently not launched yet) store.
Is anybody noticing the same problem? This is really scary as it seemed to have broken on its own.. I hope someone here can shed some light on the matter.
Thanks for any help or advice!
Try adding the trailing slash below [after "/swim"]:
/* Product Tag Filters - Good for any number of filters on any type of collection pages */ /* Give you product tag filter select element a class of coll-filter */ /* Give your collection select a class of coll-picker */ /* Brought to you by Caroline Schnapp */ var allFilters = jQuery('.coll-filter, .coll-picker'); allFilters.change(function() { var newTags = []; jQuery('.coll-filter').each(function() { if (jQuery(this).val()) { newTags.push(jQuery(this).val()); } }); if (newTags.length) { var query = newTags.join('+'); if (jQuery('.coll-picker').length) { window.location.href = '/collections/' + jQuery('.coll-picker').val() + '/' + query; } else { // IN THE LINE BELOW window.location.href = jQuery('<a title="Show products matching tag " href="/collections/swim/"></a>').attr('href') + query; } } else { if (jQuery('.coll-picker').length) { window.location.href = '/collections/' + jQuery('.coll-picker').val(); } else { window.location.href = '/collections/swim'; } } });
Subject | Author | Latest Post |
---|---|---|
Subject | Author | Posted |
---|---|---|
2 seconds ago | ||
48m ago | ||
50m ago | ||
2 hours ago | ||
2 hours ago |
User | Count |
---|---|
88 | |
62 | |
61 | |
56 | |
37 |