[Pdx-pm] Shopping Cart Logic

Carl Scripter carl at scripter.com
Fri Mar 7 10:53:01 CST 2003

> My problem is when a customer does not check out the records in the
> shopping_cart table get abandoned.  I really don't like this idea.  I
> could write a cron to delete the records that are x days old, but I am
> wanting something that does not require an outside process.  What other
> ways can I keep the database nice and clean?

I would think that most shopping cart websites are best if a customer's
cart contents stay active .. forever.  Yes, this creates a bloated
database -- but you can do so much more...  Are you implimenting user
sessions?  If so, when a session expires, flag the user record as "busy."  
This infers that the user has gone away to think about the purchase .. for 
however long it takes :)  Also, at the next login, you could perform 
queries on dated cart items:

"Welcome back, it looks like you had some items in your cart that we no 
longer carry .. but CLICK HERE FOR SOMETHING BETTER."  I know bad example 
-- but you get the idea.

If you are absolutely against stale records in the database, keep all the 
cart information in a cookie -- at least there's a /good/ chance the user 
sees them again.

I like the first idea -- flag the old contents as old, but still 
potentially active.  Maybe it's the salesperson in me :)

      __  __
     / /\/ /\
    / / / / /  // Carl Scripter
.  / / /\ \ \  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
   \ \ \/_/ /  life:      http://www.scripter.com
    \ \_\_\/   screaming: http://www.dlimitr.com
     \/_/      streaming: scripter.com:8888

Please note: All emails to and from me are filtered through SpamAssassin
[http://www.spamassassin.org] and may be deleted automatically if they
contain common spam phrases and/or falsified mail headers.

More information about the Pdx-pm-list mailing list