Updating basket value in Ajax

Highlighted
New Member
11 0 0

Hi Shopifiers!

On my store when you add items to the basket, the basket quantity counter updates automatically through Ajax without a page refresh, yet the basket value doesnt and needs a page refresh.

Does anyone know how I can solve this? How I can call that value through Ajax at the same time as the qty?

Here's my store: https://www.vehicle-spares.com/collections/crash-parts/make_ford+model_fiesta+style_5-door-hatchback...

Thanks in advance!

0 Likes
Highlighted
Shopify Partner
976 197 234

Hello,

In ajax success function add this JS

$('.header-cart-btn.cart-toggle small').text(res.item_count);

 Here 'res' is ajax success return so may be a/to theme JS code it different.

Thanks
 

Want to modify or custom changes on store hire me.
My Email: guleriathakur43@gmail.com
Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate small Click here (Its my paypal)
0 Likes
Highlighted
New Member
11 0 0

Hi Guleria!

Thanks for your response. I cant find this in my code which I am guessing would be in "ajaxify.js.liquid"?

Thanks

Simon

0 Likes
Highlighted
Shopify Partner
976 197 234

then manually find in related files and once you find it follow above step I shared.

Want to modify or custom changes on store hire me.
My Email: guleriathakur43@gmail.com
Skype: navrocks1
If helpful then please Like and Accept Solution.
If you are happy and want to donate small Click here (Its my paypal)
0 Likes
Highlighted
New Member
11 0 0

Sorry Guleria, i'm not that clued up on Ajax and JSON functionality. Are you able to elaborate? If I send you the code would you be able to tell me where it needs to go?

0 Likes