How to add conditions to filters (show only available possible filter tags)

Hi,
I am writing here as i have the product filters by tag implemented in my shop (as you can see there: https://fitzandhuxley.com/collections/all-products)
What i would like to do is to make the filters adapt to the ones previously selected, and therefore show only the available filters corresponding with the filters already selected. For example: if i select the category “Weekender Bags”, i would like to have the “Color” section only showing the colors available for the Weekender Bags, and not all the colors.

Does someone knows if something like this would be possible? If not, is there a workaround? I think i am not the only one to ask for this, as i found someone having the same issue as me here: https://community.shopify.com/c/Shopify-Design/Show-only-available-possible-filter-tags/td-p/475346
But i didn’t really get the answer.
It would be really useful to have this, because right now it shows lots of dead results on my page
Could you please help me with this?

I am using the Flex Theme by Out of the Sandbox
Thanks in advance.

You have 2 solutions :

1- Hire a developer to fix the issue (may be too costly), because your filter doesn’t work properly
2- Get a theme mainly developed for large businesses which require a functional filter, Plak theme is the king when it comes to filtering, you can check this site which is uses plak theme, once you chose a tag, the other non-existent tags disappear so your customers will never get (no products found in this collection) + you can filter within a collection

Best of luck

Hi @paulfouche ,

Can you send me the code of the filter? I will guide you, you need to change: collections.all.tags => collection.tags

Or you can upgrade your filter to store version 2.0, You can check at: https://github.com/Shopify/dawn/blob/main/sections/main-collection-product-grid.liquid

Hope it helps!