Jump to content

Cart Number Changing from 1 to 0 When Exiting Cart

Go to solution Solved by paul2009,

Recommended Posts

I really need some help with a cart number error.

I have attached a screen recording video of my problem. On my site, when you add a product to the cart, the cart shows 1 (which is good), then when you click into the cart, the product shows and the cart still shows 1 (also good). But when you click out of the cart, the cart number reverts back to 0 (not good). When you click back into the cart, the product is still there and the cart number shows 1 again (correctly).

I have contacted Squarespace support about this and they identified for me that my Cookie Control banner seems to be causing the conflict. I added my Cookie Control banner by through the Code Injection feature using the script for it produced by Cookie Control from Civic, who produce the Cookie Control feature.

I'd like to keep this Cookie Control feature, but I need my cart to work correctly.

Can somebody advise on some code I can add in order to make the cart work correctly please? The help would be hugely appreciated!

Thanks,
Pawel

Link to comment

Please post the URL for a page on your site where we can see your issue.

A link to the backend of the your site won’t work for us, i.e. a url that contains /config/.

Please set up a site-wide password, if your site is not public and you've not already done so.

Post the password here.

Adding a site-wide password does not allow anyone to alter your site. It only allows those with the password to see your site.

Please read the site-wide password and how to share a link documentation to understand how they work.

We can then take a look at your issue.

You may find How to post a forum question post useful.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment
  • Solution
2 hours ago, Pawel2021 said:

On my site, when you add a product to the cart, the cart shows 1 (which is good)...but when you click out of the cart, the cart number reverts back to 0 (not good). I have contacted Squarespace support about this and they identified for me that my Cookie Control banner seems to be causing the conflict.

Can somebody advise on some code I can add in order to make the cart work correctly please?

You shouldn't need code. This issue is occuring because your third party cookie management solution appears to be blocking one or more of the Squarespace cookies that are 'essential' for the cart. These include 'CART' and 'hasCart'. When you've configured your cookie software so that it does not block these, you should be able to test it successfully 🙂.

Did this help? Please give feedback by clicking an icon below  ⬇️

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Link to comment

 

@paul2009 Thank you so much!! Your advice directed me in the right direction for honing in on this issue. Lo and behold, I've adjusted the configuration in the code for the Cookie Control feature so that the CART and hasCart cookies are protected and the cart works now!

 @creedon Thanks for responding. Apologies. My site is live and the address is www.football-infographics.com. The issue is resolved thanks to Paul's guidance.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.