How to auto update cart total price in header using AJAX?

mitsukeru
Shopify Partner
1 0 0

I've created a custom header for a site I'm working on and I have the cart total price displayed in the header underneath the cart button - as liquid renders server side the page needs to be refreshed for the total to update. 

 

I'm trying to build a function that auto updates the total when an item is added or removed from the cart but I've hit a roadblock and can't find an answer anywhere. I know I need to use AJAX but bit of a noob when it comes to this. 

 

For reference site is octi-ransom.myshopify.com, password is 'nigel'. Site is built on Dawn as a base.

 

Appreciate any advice with this!

 

Replies 0 (0)