How to Reload Cart Weight Total automatically when an item is removed from the cart?

How to Reload Cart Weight Total automatically when an item is removed from the cart?

MetroWholesale
Visitor
2 0 3

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();

 

MetroWholesale_0-1706554176066.png

 

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!

 

 

 

 

Jacob,
Manager
Metro Wholesale SD
1606 W Frontage Road
San Diego, CA 91911
jacob@metrowholesalesd.com
www.metrowholesalesd.com
Replies 0 (0)