Hi,
I’m having issues with this - needing to hide a snippet if a metafield is blank.
Firstly I tried this method:
{% if product.metafields.my_fields.sku != blank %}
{% else %}
{% render ‘text-with-icon’, icon: block.settings.icon, text: block.settings.text, link: block.settings.link %}
{% endif %}
I got the blank on everything - the content didn’t appear even when the metafield was filled.
I then tested to make sure that the string was correct, which it was:
{{ product.metafields.my_fields.sku }}
Because that didn’t work, I tried the opposite of blank:
{% if product.metafields.my_fields.sku == true %}
{% render ‘text-with-icon’, icon: block.settings.icon, text: block.settings.text, link: block.settings.link %}
{% endif %}
Still not having any joy. Looking at previous posts, it looks like some have resolved this, but I can’t get it to work any which way. Help please!