Re: Add to cart but cart is empty until refresh the page

Add to cart but cart is empty until refresh the page

seangrue
Visitor
1 0 0

When I add items to my cart and then clear it, the next time I add items, the cart remains empty. I have to refresh the page for the items to appear. Additionally, when the cart is empty, I receive a script error.

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'parentNode')
at gsp-spf.min.js?sfid=0c4f0b7c-a09b-48c8-bf0f-b9de838af8b1&shop=luxury-hotel-robes.myshopify.com:1:10064
at Array.forEach (<anonymous>)
at gsp-spf.min.js?sfid=0c4f0b7c-a09b-48c8-bf0f-b9de838af8b1&shop=luxury-hotel-robes.myshopify.com:1:9991

 

https://www.luxuryhotelandsparobes.com/

Reply 1 (1)

Shadab_dev
Shopify Partner
1024 56 100

Well this is happening because as some bug in your code stops the cart to load asynchronously. So the function does work but not updating instantly.

 

I have had a few projects as this. Just need to debug the code and find where the error is coming that stops from just the cart to update instantly so you will not need to refresh the page.

 

Please reach out via mail for a convenient conversation and collaboration.

 

Best

Shadab

Buy me Coffee, if you feel i was helpful. Email Me or WhatsApp me for any help with shopify theme customizations or any project in web dev. If this is helpful, please Like and Accept the solution.