Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
how can i update variant metafield value when variant change. right now I am using this code.
{% for variant in product.variants %} {% if product.selected_or_first_available_variant.id == variant.id %} <strong>{{ variant.metafields.custom.customprice }} </strong> {% endif %} {% endfor %}
but it only render the meta field value one time if I visit variant 1 URL then it shows variant 1 meta field value but on same page when I change to variant 2 then metafield value is not updating. but when I visit variant 2 via URL then it show variant 2 metafield value.
I need the same.
Have you found a solution?
Find Global Growth Opportunities For Your Business with Shopify AcademyLearn how to exp...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025