Not variant.metafields. text display

MarcoAP
Tourist
16 0 2

Hello,

Today I built some metafiles into our shop that are offered via Shopify.
The product.metafields.my_fields. work, only with the variant.metafields.my_fields
I don't get any output on the page.

Works:
{{product.metafields.my_fields.speciality}}

It does not work:
{{variant.metafields.my_fields.variante_besonderheit}}

Am I doing something wrong, do I have to change the text output for variants?

 

Bildschirmfoto 2021-07-30 um 21.50.jpg

Thanks
Marco

 

0 Likes
MarcoAP
Tourist
16 0 2

The further attempts did not bring anything either, I was not given any text for the variants. Anyone else from you have an idea?

0 Likes

You need to add "for" variant for it. Refer
{%- for variant in product.variants -%}
{{variant.metafields.my_fields.variante_besonderheit}}
{%- endfor -%}
Hope it clear to you.

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!
0 Likes
MarcoAP
Tourist
16 0 2

Hello LitExtension,

Thank you, it looks a lot better

How can I just output the text for the selected varinate?
With your example, the text is displayed for both variants.

Thank you
Marco

0 Likes