Jump to content

Cart stays empty after clicking "add to cart" button -> cookie problem


Mat_D1245

Recommended Posts

Hi Presta People,

 

I have a major problem: when I click "add to cart", the cart stays empty. 

 

The product is shown on the overview though, but when I actually go to my cart, it is empty.

 

In Back Office, it is logged as abandoned cart.

 

If I use the private mode of my browser, everything works well.

 

I therefore suspect a cookie problem, can it be?

 

This is a new bug, up to now we had other problems but at least the shop was working properly.

 

If anyone has an idea to solve my problem, I'd be really thankful!

 

We have a presta 1.6.0.14 powered by NginX.

______

 

EDIT: I already tried twice clearing my smarty cache and deleting class-index.php

 

EDIT 2: it is a cookie issue, I cleared my presta cookies in my browser, and now it works again.

Edited by Mat_D1245 (see edit history)
  • Like 1
Link to comment
Share on other sites

Thanks, but that's an other issue I haven't sorted yet.

 

The problem lies in the cookies. I got calls from customers reporting that issue, and I could recreate that issue myself. For the five customers how called, I don't want to know how many moved on to another shop because they couldn't buy from us!!

 

All I need now would be to force new cookies...

Link to comment
Share on other sites

  • 2 weeks later...

Thanks, but that's an other issue I haven't sorted yet.

 

The problem lies in the cookies. I got calls from customers reporting that issue, and I could recreate that issue myself. For the five customers how called, I don't want to know how many moved on to another shop because they couldn't buy from us!!

 

All I need now would be to force new cookies...

 

Hi Mat_D1245

 

I'm experiencing the same exact problem. Chrome and IE and only know about it when a customer calls. Clearing their cookies allows them to see the items in their cart. The problem is inconsistent so very hard to troubleshoot.

 

Turning off ajax cart seemed to keep things quiet for a few weeks.

 

I'm going to try turning off most of the CCC options (developer said they were causing a CPU load too).

 

This is frustrating. Did you have any luck?

 

Robyn

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Hi! 

 

I think I have hit the same issue - here is what i found out.

 

I am running 1.5.6.0.

 

I am trying to use the add items to a cart via a link from an external site.

I am using this link: http://www.snkrs.com/en/cart?add=1&id_product=5500&qty=1

 

If the browser havn't visited the site yet, it does not allow adding items to cart, maybe because the cookie/token does not already exist.

 

I can recreate the problem I IE (IE 8, Safari, Chrome), if I clear all browser data (cookies) or private browse and try to hit the link above, first time it just goes to the front page.

If I then hit the link again it adds product 5500 to the cart, as expected.

 

I really hope that someone can come up with a solution for this problem.

 

Kind regards

Morten

Link to comment
Share on other sites

  • 5 months later...
  • 5 months later...

Experienced similar problems with www and cookies with a multistore setup (on PS 1.6.0.9) for quite some time now. In more detail, the problem was the following:

 

Our primary shop URL includes the www. subdomain.

If a client navigated to the URL without www. subdomain, PrestaShop would redirect correctly to www., but not after having created a PrestaShop cookie for the domain without www. 

Clients were therefore left with two cookies, one with and one without www. The one without www overrules the www-cookie, rendering login as well as cart broken on the www. domain.

 

 

Manually removing the non-www-cookie would fix the problem, however, a permanent solution for us was the following:

 

Advanced Parameters > Multistore > click on a domain name

 

Here, we had 4 domains set up, two for each multistore; with and without www. Despite the non-www domains being disabled, it seems like PrestaShop was still accounting for them. Deleting the (disabled) non-www domains stopped PS from creating the non-www cookies.

 

 

Not sure if PrestaShop creating cookies for disabled domains is expected behaviour or not - but this stumped us for quite some time. Hope it helps someone else.

Link to comment
Share on other sites

  • 1 year later...

I would like to know how to force to regenerate cookies for presta guests.  If this will work if I will change cookie sesion key in config file?

 

EDIT - Found the solution here https://www.prestashop.com/forums/topic/364875-how-to-delete-cookies-customers/?do=findComment&comment=2348354

 

You just need to change the cookie name and it will generate it once again - works every time.

Edited by hakeryk2 (see edit history)
  • Like 3
Link to comment
Share on other sites

  • 8 months later...

I know this is an old thread, but I found out what was my issue. I tried all above but nothing worked.

Then I discovered, that the quantity was actually zero when adding the product to cart.
I therefore checked the product settings in the backend, and the minimum amount/quantity was set to 0 at all products.
Don't know if this is an import/export thing when upgrading the shop, but that was my case. Hope this helps someone else 🙂

Link to comment
Share on other sites

On 10/9/2018 at 5:56 PM, hakeryk2 said:

I would like to know how to force to regenerate cookies for presta guests.  If this will work if I will change cookie sesion key in config file?

 

EDIT - Found the solution here https://www.prestashop.com/forums/topic/364875-how-to-delete-cookies-customers/?do=findComment&comment=2348354

 

You just need to change the cookie name and it will generate it once again - works every time.

Thanks for sharing! Seems to be an immortal bug - I had the same issue with customer's cookies and, well, code fix (from the last post by annoyingusername) helped to resolve this. Until then customer had to clean cookies manually.

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

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

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...