Im trying to figure out how to handle obsolete shopping cart info when a customer adds items (to be bought) and returns 1 day later to find the same items still in the cart. I use cookies to identify the customer. Im very new to php but know coding on general. Think there are two ways (please advice if there is more!):
1) to somehow delete from the shopping cart table when customer closes the browser(s) - for his cookieID
or
2) to modify the cookie lifetime so that it is not living long in the users pc (i use 365 days)
what is the best practice of the above? and are there any predefined functions for 1)
thanks
Serap
Handling obsolete shopping cart info
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
-
markbeadle
- Forum Commoner
- Posts: 29
- Joined: Tue Dec 02, 2003 2:50 am
- Location: Aachen, Germany
After adding a date to the database you can also have a cron job which deletes items in the cart after a fixed time has passed (2+ days to allow for if someone if shopping at midnight). Or move the items to another table for reporting purposes (Items added to cart but not brought).
This will keep the cart table smaller.
This will keep the cart table smaller.
- Derfel Cadarn
- Forum Contributor
- Posts: 193
- Joined: Thu Jul 17, 2003 12:02 pm
- Location: Berlin, Germany