Hide image placeholders Metafields if blank

Hello

I have defined one of the product section blocks to use an image/file. text and multitext meta fields… all are shown along with the image when all the related data is added on product page, but when the image is not uploaded or empty it still shows a placeholder instead.

Why is it doing so? and how can we hide it? Screenshots attached.

This is with the blank placeholder

https://3qa1l855p1dr1gqy-37857919111.shopifypreview.com/products/wellbe-multi-millet-muesli-with-seeds-300g

This is with all showing proper

https://3qa1l855p1dr1gqy-37857919111.shopifypreview.com/products/wellbe-kodbale-180gm

Found out on my own…

I ended up using a custom liquid block and placing the metafields in the {{metafield}} format to show and using {{if statement}} for not showing data if not there.

Hi @rakeshdsouza

Please add if statement

{% if product.metafields.custom.save_xx_eur != blank %}
       		{{ product.metafields.custom.save_xx_eur }},// add you metafield value
           {%  endif %}

like

1 Like

In which file can I paste this code? I don’t find it.