Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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!
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025