How to stop certain metafields appearing on certain products?

Hi,

I have set-up a ‘care guide’ metafield for my products.

However, not every product needs a ‘care guide’.

I have setup the Product Template to include a ‘collapsible row’, and then I set it up using dynamic content for ‘care guide’. However, I do not want the collapsible row visible on pages that do not have a metafield.

How can I make this possible?

Hi,

Need to Implement Liquid conditionals in the product template

Code example

{% unless product.tags contains 'hide_metafield' %}
  {% if product.metafields.your_namespace.your_metafield_key %}
    

{{ product.metafields.your_namespace.your_metafield_key }}

  {% endif %}
{% endunless %}