I've customized my collection page template to filter products using two sets of filters that operate separately.
The first set of tags is shown by using
The second set is shown by using
Now when customers select a tag from the first filter, the second filter is activated, and they can choose from there. But once they select one from the second set, They don't see the other tags from the set. I want customers to be able to switch between tags in the second set. (I have to mention that my only problem right now is to show the tags in the dropdown, I already have the codes to switch the second tag only)
Is there a way to get available tags from the URL or any other way to get this to work?
Can you please share the store URL so that we can visualize the issue?
Here's an example collection. Thank you
Your second filter list is dynamically created, right? But when you do select even on 2nd filter how does the collection rendering happen? It will only give a subset of product which will gain get iterated by the first filter and at some time the second filter will get activated, it is likely that all tag may not populate as the input was a subset. Please see if it makes sense
@Propero Thank you for your reply
To get the filtering work, when the 1st filter is selected, it assigns the new URL to a variable(example: www.mystore.com/collections/collectionname/tag1 ), now when the second one is selected, it is added to the end of that URL and creating something like www.mystore.com/collections/collectionname/tag1+tag2. This works how it is supposed to. Now since collection.tags "returns the tags of products in a collection that match the current view (for example, if you are viewing a collection filtered by tag, collection.tags will return the tags for the products that match the current filter), when only tag1 is selected, it shows all available tag2s, if you switch tag1 you will see a new list of tag2s again. But when you add a tag2, because of collection.tags behaviour you only see tags of products that match the current view, therefore you can't switch between tag2s available using www.mystore.com/collections/collectionname/tag1.
So basically I'm looking for a way to always return the tags of products in a collection using a URL or only consider the first tag.