How can I display only one variant description at a time on Dawn 10.0 theme?

Hello

Has anyone had success with variant descriptions on selections for Dawn 10.0 theme. I have created metafield and created a liquid block in product infor on the customization. The script is:

{%- for variant in product.variants -%} {{variant.metafields.custom.description_for_variant | metafield_tag}} {%- endfor -%}

The description for ALL variations is displayed and I am unable to show variant description for 1 variant at a time.

Appreciate help from anyone who has been able to solve for this or in any other way.

Thanks

Hi @Sunshine10

Update your code with the below one.

{%- for variant in product.variants -%}

{{variant.metafields.custom.description_for_variant | metafield_tag}}

{%- endfor -%}

Now you just need to write a script on click of variants, which will give you the variant ID, and you will set .hide element to display:none and selected variant id to display:block

Hope this will help…