All things Shopify and commerce
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' %}
<div class="yotpo-widget-instance" data-yotpo-instance-id="124763"></div>
{% endif %}
{% if customer.tags contains 'swell_vip_badass' %}
<div class="yotpo-widget-instance" data-yotpo-instance-id="124761"></div>
{% endif %}
{% unless customer.tags contains 'swell_vip_boss' or 'swell_vip_badass' %}
<div class="yotpo-widget-instance" data-yotpo-instance-id="124696"></div>
{% endunless %}
The {% unless} portion is not showing when I've added multiple tags. Should I be using a different script?
Thanks!
Solved! Go to the solution
This is an accepted solution.
For multiple conditions you have to compare both, like this:
{% unless customer.tags contains 'swell_vip_boss' or customer.tags contains 'swell_vip_badass' %}
<div class="yotpo-widget-instance" data-yotpo-instance-id="124696"></div>
{% endunless %}
By the way, fun tier names, I always like seeing something different than bronze / silver / gold 😃
This is an accepted solution.
For multiple conditions you have to compare both, like this:
{% unless customer.tags contains 'swell_vip_boss' or customer.tags contains 'swell_vip_badass' %}
<div class="yotpo-widget-instance" data-yotpo-instance-id="124696"></div>
{% endunless %}
By the way, fun tier names, I always like seeing something different than bronze / silver / gold 😃
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.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025