Variant metafields

Hello,

I don’t find my metafields on the back office pages of my products. Neither when I want to customise my website and connect collapsible rows to these metafields. I have 10 products (jewels with natural stones), 10 variants for each of them (the stones) and I will have 4 collapsible rows on each product page :

  • details of the jewel

  • benefits of the stone

  • concerned chakra

  • take care of my jewell

I want a specific content for each variant and for each product to avoid duplicate content for my SEO. I might repeat the content for the benefits of the stones from one product to another one.
Now you have the context you might understand why I really need these metafields…
Please help me :')

Hey Leacha,

Your collapsible row section can’t pull any metafield data? Is that what you meant by:

Hey!
yes they can but I only find product metafields instead of variant metafields…

Hey there :waving_hand:

I see. So, Shopify doesn’t allow you to pull variant metafields for the section content. In that case, you’ll need your current section to be customized. What theme are you using?

I am using « be yours » theme.

thank you for your help !

Got it. I’d love to create the solution for you and hand it to you here, but, sad to say, without access to Be Yours’ code, I can’t. Freely handing out code to use on a paid theme often doesn’t end well.

Here is a part of the code in ‘main-product.liquid’. Does it help you helping me ? :slightly_smiling_face:

{%- for variant in product.variants -%}
{
@type” : “Offer”,
{%- if variant.sku != blank -%}
“sku”: {{ variant.sku | json }},
{%- endif -%}
“availability” : “http://schema.org/{% if variant.available %}InStock{% else %}OutOfStock{% endif %}”,
“price” : {{ variant.price | divided_by: 100.00 | json }},
“priceCurrency” : {{ cart.currency.iso_code | json }},
“url” : {{ request.origin | append: variant.url | json }}
}{% unless forloop.last %},{% endunless %}
{%- endfor -%}

I think the problem is related to collapsible-rows. Because I can connect the product metafields but not the variant metafields. Moreover, when I click on a variant when I create a new product in back-office, I see my variant metafields. But they disappear when I want to connect them with the collapsible rows.

Hi Leacha!

For the code snippet you’ve shared, yes it would help, but that code is for search engines. Don’t touch that because you’ll mess up your SEO.

Yes, the problem is indeed connected to collapsible rows. Its code needs to be changed in order to have the variant metafields show up.

If you’d like, I can take care of this for you all for free. Normally I’d charge this for $50 but since I have some time, why not help others? Am I right? That way you can work on other store problems/improvements you want and no longer have this problem.

Does that work with you? Let me know

Hi Paul,

Can you help me with the same issue?