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.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024