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.