Show certain tags in a comma separated list

Hi,

I want to show tags that contain a string in a comma separated list. I can list the tags and strip out the parts I want to display, but how do I get this is as a comma separated list?

{% for tag in product.tags %}
{% if tag contains ‘Style’ %}
{{ tag | replace: “Style_”, “” }}
{% endif %}
{% endfor %}

1 Like

@Roadjan
Checkout this link, you will get the solution,
https://gavinballard.com/comma-list-liquid-snippet-for-shopify/

hanks, but I want to create a comma separated list from my output. Currently, the ‘Styles’ come out as a list of words with a space in-between, and I want it to be a comma.