Show Content To Different Customer Segments Based On Tags

Long-time lurker, first-time poster.

We have three Rewards tiers. All customers who create an account enter the first tier, but their Shopify profiles are not tagged. Once they reach 500 points, they enter the Badass tier and their Shopify profile is tagged with ‘swell_vip_badass’. Once they reach 1000 points, they enter the Boss tier and their Shopify profile is tagged with ‘swell_vip_boss’.

Each tier receives different Birthday rewards points based on their tier. Each of these Birthday rewards require their own unique widget, so I’d like to display only the appropriate widget on the customer’s Account page; i.e., the customer tagged with ‘swell_vip_boss’ only sees the ‘swell_vip_boss’ widget.

It’s working correctly for the two tagged customer segments - ‘swell_vip_boss’ and ‘swell_vip_badass’ - but the third is proving to be tricky, because this segment is not tagged. This is what I’ve done:

{% if customer.tags contains ‘swell_vip_boss’ %}

{% endif %} {% if customer.tags contains 'swell_vip_badass' %}
{% endif %} {% unless customer.tags contains 'swell_vip_boss' or 'swell_vip_badass' %}
{% endunless %}

The {% unless} portion is not showing when I’ve added multiple tags. Should I be using a different script?

Thanks!

For multiple conditions you have to compare both, like this:

{% unless customer.tags contains 'swell_vip_boss' or customer.tags contains 'swell_vip_badass' %}

{% endunless %}

By the way, fun tier names, I always like seeing something different than bronze / silver / gold :smiley:

Hi there!

Nice explanation!

Is there a way to do this into the product content text area (the field called description)?
I need to hide some information to a certain group of users.

I tried your solution but the code would show up on the front end.

Ya you should be able to, check the Liquid reference docs to find variable options: https://shopify.dev/docs/api/liquid/objects/product

product.description should work.

If your code is showing up on the front end, you have a syntax error or broken code somewhere.