Display variant metafields for each variant for Blockshop Theme

Hi there!

I’ve been searching for ways for Variant Metafields For Each Variant to show on my website and I’ve come across this code.

{%- for variant in product.variants -%}
<div class="hide {{variant.id}} variant_desc">
{{variant.metafields.my_fields.name | metafield_tag}}
</div>
{%- endfor -%}

However, it shows all of the information.

I just want the information on the chosen option/product to show. Any help would be appreciated! Thanks!

I must admit, I am not too well versed with Liquid. But could you try removing the

{%- for variant in product.variants -%} and {%- endfor -%} lines. See if that helps.

Thanks for the input and much appreciated it. I’ve tried removing it however, now it won’t show anything.