Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Shopify Community Downtime: The Shopify Community will be down December 5th for 15 minutes between 3pm and 4pm EST. Thank you for your understanding.

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
891 49 87

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.