[Debut] How to filter by all tags that have a common tag

Highlighted

Hello,

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

  1. collection.all_tags
  2. if the first character of the tag is '1'

The second set is shown by using

  1. collection.tags
  2. if the first character of the tag is '2'

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?

-Like and Mark as an Accepted Solution if my reply is helpful
I'm not an expert, these are my own experiences or codes that I gathered from others. I'm using Debut.
I have my own online pet supply store check it out at
PETLANTIS.CA
0 Likes
Highlighted
Shopify Partner
552 67 89

@Ardi94 ,

Can you please share the store URL so that we can visualize the issue?

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution

Skype : lokendra.panwar1
0 Likes
Highlighted

https://petlantis.ca/collections/dog-bowls-feeders

Here's an example collection. Thank you

-Like and Mark as an Accepted Solution if my reply is helpful
I'm not an expert, these are my own experiences or codes that I gathered from others. I'm using Debut.
I have my own online pet supply store check it out at
PETLANTIS.CA
0 Likes
Highlighted
Shopify Partner
552 67 89

@Ardi94 ,

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

 

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution

Skype : lokendra.panwar1
0 Likes
Highlighted

@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.

 

-Like and Mark as an Accepted Solution if my reply is helpful
I'm not an expert, these are my own experiences or codes that I gathered from others. I'm using Debut.
I have my own online pet supply store check it out at
PETLANTIS.CA
0 Likes