how to store spécific tags un a variable

MarionH
New Member
3 0 0

 

Hello, I would like to retrieve the tags which have a prefix "filter" or "Filter" and then store only their suffixes in a variable.

But I can't do it. Currently, I manage to store only one tag since the variable is reassigned to each new tag containing "filter" or "Filter

If any of you have any tips, I'm interested.

for info I code in a template collection

{% capture tags_list %}
  	{%for product in collection.products%}  	
  		{%for tag in product.tags%}
  			{% if tag contains 'filter' or tag contains 'Filter' %}
  				{% assign products_tags_list = tag | split: '_' | last | handleize %}
  			{% endif %}
  		{%endfor%}  	
  	{% endfor %}
  {% endcapture %}
0 Likes
MarionH
New Member
3 0 0

I finally found it much simpler ... I just used "collection.all_tags".

if I liked it can help someone;)

0 Likes