In shopify I have created a page and have added the following metafield to that page: page.metafields.custom.listing_tag. Let’s pretend that the value of that metafield is “blue”.
If a customer is logged into the store and they have a customer tag of “blue” (notice that it matches the value of the metafield for that page) then I want to show them Content A. If they are logged in but do not have a customer tag of “blue” then show them Content B. If they are neither logged in or have a maching customer tag of “blue” then show them Content C.
This is what I have so far but it just isn’t working:
{% if customer %}
{% assign listing_tag = page.metafields.custom.listing_tag %}
{% assign customer_tags = customer.tags | split: ',' %}
{% if customer_tags contains listing_tag %}
Content A
{% else %}
Content B
{% endif %}
{% else %}
Content C
{% endif %}