cart.total_price doesnt refresh

cart.total_price doesnt refresh

Anthony808
Visitor
3 0 0

How can I automatically update {{ cart.total_price | money_with_currency }} in the cart / cart drawer whenever any product is added or removed?

 

Currently, if I add or remove a cart upsell product the {{ cart.total_price | money_with_currency }} doesn't refresh unless the page is entirely reloaded or another product's quantity changes.

Reply 1 (1)

Guleria
Shopify Partner
3944 791 1120

Hello @Anthony808 ,

 

Find and check the theme JS function which refresh the cart total on click of default atc button.

Hook the same function when your upsell product added the cart.

 

Or using own ajax call, rewrite the cart total when bundle product added to cart.

 

https://shopify.dev/docs/api/ajax/reference/cart

 

Regards
Guleria

 

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder