Jump to content

Weird: shopping cart empty after logout/login - but not all customers

Recommended Posts

Hi community,

i have a weird problem with keeping products in cart after logout/login.

I started with PS updated to and finally to (PHP 7.3.26).

Since products in carts are not being kept, but only for customers which are added since PS

I have two customers that where added in and their carts persist between sessions. I looked at ps_customer table but all values of a new testcustomer and the 'working customer' are the same 🤔

In ps_cart i can see the cart with  id_customer which is the one from testcustomer. Even secure_key is the same in ps_cart and ps_customer. But why doesn´t the old cart get loaded - instead a new one is created in ps_cart.


PS: Yes 'Re-display cart' is activated / changed PHP back to 7.2 didn´t help


Any ideas someone?

thy hamsta

Share this post

Link to post
Share on other sites
  • 4 weeks later...

Yes i resolved it.

But this depends heavily on our shop configuration: We configured as private shop so only registered customers are allowed to login and see the shop.

So we disabled some authorized modules (BO > customers > groups) for the customer groups 'visitors' and 'guests' so they can´t see header/menu/footer/search/....
And even it makes no sense to me, why i shouldn´t disable the cart module for these groups, as they don´t need it anyway - this was my error.
Seems some cookie/session/token/connetion stuff is running in background, so even if you logged back in FO, PS automatically inserted a new fresh cart in ps_cart table ignoring the one the customer had before (even though it´s still saved in ps_table).

I don´t know how your shop is configured, but if that´s not the same problem, you might search for s/th that has todo with autoincrement values of some tables.

I guess you already found this before, ´cause that´s the basic setting:


greets hamsta


Share this post

Link to post
Share on other sites

It's unbelievable. Yesterday I reinstalled the prestashop store. I installed clean from the beginning step by step (fresh database). I only transferred products and categories (No customers, no carts). After that, I made myself a test client. For this customer, saving the cart works all time (even now). The basket is restored each time. Today I am register another client and the baskets are not working again ..... : /.  There is an obvious problem. At the moment I have theme warehouse installed and about 6-7 external modules. Meybe it is related to statistic modules which i disable (not delete). I dont know.


Share this post

Link to post
Share on other sites

Yes, activate the statistic module in BO.

Turned on, the table ps_guest will be filled again (among the ps_connections) and so you will have a id_guest written to ps_cart.
As soon as you login as customer, the id_customer is set too.

Turn of all the other statistic modules that you don´t want, but keep the main data-mining satistic module (v2.1.0 right now) activated.

I don´t know your theme, but be shure, you didn´t deactivate the cart module (or cart module from your theme) in the user groups of visitors and guests in BO.




Share this post

Link to post
Share on other sites
Posted (edited)

After testing, it seems to me that this is the fault of the prestashop theme which I use. I installed a clean store with sample data from presta (on another server and domain). Until the default theme is installed, everything is fine. The tables in the database are correctly filled. A problem occurs after installing the theme. The tables in data base stop being filled - i mean ps_connection and ps_guest. In ps_cart the column id_guest fills "0". When I manualy change "0" for different value this specific cart start to be restored for client.
 I do not change anything except installing the template. Statistics modules all active as at the beginning. I checked the settings you indicated. I have an active cart module for each group (as well as other modules). I use theme which name is WAREHOUSE from themeforest site. I think something is wrong with this theme :(. 

Edited by kerami82 (see edit history)

Share this post

Link to post
Share on other sites

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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More