Product variant metafields not updating correctly

Hi!

I’m trying to show some information from metafields of product variant on the product page. But when I change the current variant the metafields data is not updating, it shows always the metafields of the first variant.

Can someone help us on solving this issue please?

Thank you!

Hello @gjulio96 ,

Follow the theme existing function which change the price or other product info. on change of the variant.

Once you find it then extend it so product metafields will also change on change of the variant.

or if you are good with JS then you can write your own code to change it a/to the variant.

Thanks

1 Like

Hi @gjulio96 ,

We do need to use JS for this.

We need to loop the variant and its metafield and make the changes accordingly.

Let me know if you need any assistance.

Thank you

1 Like