variant.id not updating when use changes selection

variant.id not updating when use changes selection

Martinski
Visitor
3 0 1

We are displaying product variant meta fields for package size and weight, using liquid code on the product page.

However when the use chooses a different variant the variant.id does not change, though it does on the url. If we refresh the page the variant.id does get updated. Is there a call I can make to update the variant.id??

 

liquid code is

 

{% for variant in product.variants %}
{% if product.selected_or_first_available_variant.id == variant.id %}
{% assign current = variant.id %}
<div class="variant__description">
<p>ID is {{current}} </p>
<p>Package Weight {{ variant.metafields.custom.package_weight }}</p>
<p>Package Dimensions {{ variant.metafields.custom.package_size }}</p>
</div>
{% endif %}
{% endfor %} 

 

can anyone help

Martinski
Replies 0 (0)