Forum Moderators: buckworks
I am building a shopping cart for my company and I'm wondering how to delete entries in the users_cart table. I was curious how long I should leave a users cart session in the database. Also is it possible that when the user leaves the site or closes the browser window that the cart can be deleted? That could pose problems so what if I deleted it after a week or so. How could I setup an automated script that deletes old cart sessions?
Thanks for your help :)
Wes
If there is a slightest possibility that returning customer comes back and finds something that he/she wanted to buy some time ago, but did not by some reason -- perhaps he/she will decide to buy it now?
However, I would recommend saving all cart data and never purging it on your end. This allows you to view trends such as whether a product is going out of style, whether your conversion rate for a product is rising/dropping, etc.
However, once the cart gets a few weeks old, you won't want to show it to the user anymore. They'll likely forget they started a cart and be confused, or your pricing may change. Regardless, a cart is stale after a couple weeks.