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.
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025