Only show specific collections

I would like to tag the customer, and if there is a collection with the same name show that collection also for that specific customer.

{% if customer.tags == collection.title %}
{% endif %}

Something like this i guess, but how would a write it exactly and where do i put it in?

Tanks friends

Hello there,

Open the template file where you want to display the collection based on the customer’s tag. This might be in a product template, collection template, or another relevant template file in your Shopify theme.

Add the following Liquid code to loop through collections and check if the customer has a tag that matches the collection’s title:

{% assign customer_tags = customer.tags | split: ',' %}
{% for collection in collections %}
{% for tag in customer_tags %}
{% if tag == collection.title %}

## {{ collection.title }}

{% endif %}
{% endfor %}
{% endfor %}