Adding an image to the sidebar on a specific product (on main product page)

Hi - I’m in need of help with this simple liqued code.
I want to add an image (GOTS logo) on some of my products (not all are GOTS certified).
I have tagged the product with; show-gots-logo

Then, in the main-product.liquid I have inserted this code under the collapsible content section of my product sidebar.

{% if product.tags contains 'show-gots-logo' %}
  <div class=\"gots-logo\">
    <img src=\"https://cdn.shopify.com/s/files/1/0234/8013/files/show_gots_product.png?v=1746605466\" alt=\"GOTS Certified\">
  </div>
{% else %}
  <p>Tag not found</p>
{% endif %}

I have tested the img link and it is fine. The code shows up on my product, so it almost works, but how do i get to display the img ? (Only testing on a single product).

Hope someone can help me :slightly_smiling_face:

Thanks

Marlene

Hi Marlene :waving_hand:

Try this corrected code:

{% if product.tags contains ‘show-gots-logo’ %}

GOTS Certified
{% endif %} This will display the GOTS logo only for products tagged with show-gots-logo. No need for backslashes inside HTML tags in Liquid files.

Thank you SO MUCH! Now it works! :grinning_face: