Custom element in cart disappearing when changing quantity

Solved
Gary_Dev
New Member
2 0 0

I've added a span into cart.liquid, however, when the user changes the quantity of the item this causes the cart to reload and the span I added disappears.

I've looked into theme.js and found that when the quantity changes it triggers the updateCart function. What I can't seem to figure out is where it's getting the re-rendered cart code from?

If the user refreshes the page after the cart re-renders the span appears again.

Does anyone know where I can change the code that the re-rendered cart is using?

Thanks in advanced

0 Likes
florinanghel
Shopify Partner
102 15 17

It depends on your theme, posting a link might help.

 

0 Likes
Gary_Dev
New Member
2 0 0

Thanks for your reply. I can't send a link right now as it's still in production/preview mode. Is there anywhere you recommend looking?

0 Likes

This is an accepted solution.

Please share a preview link of your store. A possible cause of the issue is cart data is updated via ajax when quantity change. 
There might be a snippet with handlebar js or theme.js code

Founder of Shopify agency - Accomplishify.com
Contact me on: Michal.morek@accomplishify.com
0 Likes