Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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
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
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"=>""}]}]}
🙂 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 🙂
Hey @VukVuckovic , I saw you were able to receive some help. Were you able to figure out the issue?
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024