Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025