I have a metafield called hot_offers_condition. I am trying to show an icon on the product in gallery if this metafield is set to one of several supported values.
{%- if product.metafields.custom.hot_offers_condition.value contains "New" -%}
<img class="condition-icon offer-icon" alt="New" src="https://cdn.shopify.com/s/files/1/0320/1699/0267/files/new-icon.png">
{%- elsif product.metafields.custom.hot_offers_condition.value contains "Open Box" -%}
<img class="condition-icon offer-icon" alt="Open Box" src="https://cdn.shopify.com/s/files/1/0320/1699/0267/files/ex-demo-icon.png">
{%- elsif product.metafields.custom.hot_offers_condition.value contains "Refurbished" -%}
<img class="condition-icon offer-icon" alt="Refurbished" src="https://cdn.shopify.com/s/files/1/0320/1699/0267/files/refurb-icon.png">
{%- endif -%}
When, for example,
{{ product.metafields.custom.hot_offers_condition.value }}
outputs New (as expected) the image is not showing. Is there something wrong with my string comparison? I have tried both == and contains operators.
Thanks for your help!