Add HTML in Shopify metafields
shopify-trial-fuznet

Add HTML in Shopify metafields

The metafields are unique information that you will add to your products, collections, customers etc.

If you have a Shopify 2.0 theme, you can easily make them appear on the relevant pages from the theme editor. If not, you can add them manually in the code of old themes.

Anyway, these fields metafields do not display HTML. So what to do?

It's really very simple. Let's imagine that you have added a "delivery" metafield to your products.

metafield

To display it in the code of the theme, in the desired place, you add it in this way: {{product.metafields.custom.livraison}}.

But if you added HTML like for example a truck icon, it won't work.

To fix this, just add .value in our metafield. Which give : {{product.metafields.custom.livraison.value}}.

How to display personalized information on its product sheets without going through metafields?

If you don't feel comfortable with metafields, you can always use an app like Extra Info.

Extra info

This app allows todisplay custom phrases on all your Shopify product pages in a few clicks:

  • delivery delay ;
  • warranties;
  • return terms;
  • etc .. 
Back to blog
shopify-trial-fuznet

Leave comments

Veuillez noter que les commentaires doivent être approuvés avant d'être publiés.

1 de 2