variant metafiled - how to be visible on product page?

Hi guys,

Can anyone please help me with variant metafiled?

I created a metafield, and wrote on each variant the info I want to put there (i just need a few words description for some of my variants) but I can’t make it visible on my product page. I use dawn 2.0

1 Like

Hi @VukVuckovic

You can add the code to show up in your product page by using custom liquid block.

  1. From you Admin page, go to Online store > Themes > Customize

  2. Go to product page

  3. Under the Product Information in your right hand, add a block called Custom liquid.

  4. Inside the text box of custom liquid, place the code below

NOTE: This will show the first or selected variant description.

{{ product.selected_or_first_available_variant.metafields.custom.description.value }}

To show all descriptions:

{% for variant in product.variants %}
{{ variant.metafields.custom.description.value }}
{% endfor %}

To hide and show the description base on customer’s input, you need a javascript included. You need to have a developer write that for you

Hey @VukVuckovic , I saw you were able to receive some help. Were you able to figure out the issue?

1 Like

many tnx for your reply. i did it and this is what shows up:

{“type”=>“root”, “children”=>[{“type”=>“paragraph”, “children”=>[{“type”=>“text”, “value”=>“You can buy this print framed. Click “}, {“url”=>“https://excitingcities.shop/products/washington-print”, “target”=>”_blank”, “type”=>“link”, “children”=>[{“type”=>“text”, “value”=>“HERE”}]}, {“type”=>“text”, “value”=>“”}]}]}

:slightly_smiling_face: i have no idea what does that mean - I just need a part:

"You can buy this print framed. Click…

and then I put HERE which is a link to new product :slightly_smiling_face: