Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
I am looking to get the total weight to auto update everytime there is a quantity change in the cart or an item is removed from the cart. Here is the code that I added into main-cart-footer.liquid to add in Total Weight on Cart Page.
<p>
<label>Weight:</label>
<input type="name" name="attributes[total_weight]" form="cart" value="{{cart.total_weight | weight_with_unit}}">
</p>
Everything shows up perfect, however when a quantity is updated in the cart, the page will auto refresh to update the Total Price. But it does not auto update the Total Weight that I added in, I have to refresh the page manually for the weight to change. I also tried adding this line of code to "cart.js" below updateRegions
window.location.reload();
What is the solution to fix this, and allow auto update of Total Weight in Cart every time a quantity is changed?
If someone could help that would be great!
Our website is https://metrowholesalesd.com
Thank you!