Personalized checkout and custom promotions with Shopify Scripts
Hello all,
I try to show the variants weight on my product page cause i update my theme atm. Problem is that the way i did it before not working anymore and i wasnt able to figure out why. I started over but there are some strange things.
1. I tried to use {{ variant.weight | weight_with_unit }} like before.
Made a new snippet with code:
<div style="font-size: small;">
<p>Gewicht pro Artikel:
<span id="weightpreview">{{ current.variant.weight | weight_with_unit }}</span>
</p>
</div>
2. -> render the snipped at main-product.liquid at the place i wanted
3. Output: "Gewicht pro Artikel: 0.0"
If i paste the code directly somewhere at the bottom from main-product.liquid it shows the weight suddenly but not updating it when switching the variant. And before i go to my .js question i need to know why its not showing
at least the first weight when i render the snippet.
Hope its somehow understandable and anyone knows the trick or some link with infos.
Hello,
I've got the same problem with dawn theme:
current.variant.weight doesn't work at all and shows 0 g.
product.selected_variant.weight works like
product.selected_or_first_available_variant.weight and like
product.variants.first.weight - it shows the weight of the first variant.
So I'm stuck at the moment. I use custom liquid.
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025