Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
Im trying to recreate the filter by tags functionailty that Shopify have so brilliantly removed.
I need to get a list of all the available tags within the current filtered collection but not sure on the best way to do this.
collection.all_tags - gets all the available tags but this includes tags from products which have been filtered.
current_tags - gets all the active filters
I thought Id be able to test if the tag was in collection.all_tags and then test if it wasnt in current_tags but this doesnt work as I need because some of the avilable filters should be removed when certain products are filtered but they still seem to appear.
eg, I have 3 products with the following tags
product 1 - Tag A, Tag B, Tag C
product 2 - Tag A, Tag B, Tag D
product 3 - Tag C, Tag D, Tag E
If I click on my filter to select only the products which have Tag A it displays product 1 and 2 in the list but still has the option to filter by Tag E which is no longer a valid filter as none of the displayed products have Tag E.
collection.all_tags will contain: Tag A, B, C, D, and E
currrent_tags will contain: Tag A
Is there an equivilant that will contain only: Tag A,B,C,and D as these will be the remaining valid tags which are assigned to the visible products?
Hope Ive managed to eamplain that clearly
Thanks
After no help from Shopify Pro support (other than advice to buy a paid app) I found an external website that told me to use this which seems to work.
collection.tags
Hope that helps sombody else
Thanks for the fix!
Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024