On Friday, December 5, 2003, at 08:09 AM, Chris W. Parker wrote:

I haven't had time much to work on my cart program recently but I was
just thinking about abandoned carts and can't figure something out
completely.

How do you determine if a shopping cart has been abandoned or not?

What I am thinking is that when the customer adds an item to their cart
an entry is made in a db table. That means a cart is created, and that's
about as far as I get. ;P

Well, I'd have SESSION based shopping carts, rather than DB based carts (even though the session may be DB powered). To my way of thinking, if a user abandons their session, then they abandon their shopping cart -- just like if I leave my shopping cart in isle three and walk out of the supermarket.


However, for logged in, registered members, I'd have options to:

- autosave a shopping cart (i'd store it indefinitely -- until the user is deleted, or perhaps a year)
- save a SC for later


Actually that's not totally true, so let me continue.

The only reason I can think of to determine if a cart has been abandoned
or not would be based on how old the shopping cart is. That is, when it
was last modified (had a product added/modified/deleted from it). But
who's the say that the customer that created that cart is not going to
come back to the site at some point and then checkout?


So then we have to decide how long an unmodified cart is considered
abandoned as opposed to active. Let's make that time 1 day (24-hours).

If you owned a grocery store, you'd have to decide how long you'd leave an abandoned cart in isle 3 -- 5 minutes? a week? This is entirely a decision up to you and your client. If you have 1000's of orders every hour, obviously storing every abandoned cart for a year is not an option. Why couldn't it just be a configurable option in the app?


Now let's imagine that there are four abandoned carts in the database.
Now what do we do? Does the program automatically delete the carts after
a certain (definable) period of time, i.e. 7 days? OR do we allow the
merchant to manually delete the carts at any point they want? And how do
you determine your abandoned cart rate? That is, do I take a survey of
the db evey week to see how many abandoned carts I have and then average
those results?

Run a cron job once a day (or once an hour if the site has enough traffic to warrant it) clearing out abandoned order (that you determined about would be delete-able after a hour/day/week/year). The cron job should take note of how many were deleted, so that you can establish statistics.


The problem I see is that a cart could be considered abandoned for 4
days but then become active again because the customer has come back to
it and has added more products to it. In this case I'd say it was never
abandoned in the first place and in which case it would be innacurate to
include it your abandoned cart total.

I personally would trash the cart with the session (sessions are cleaned up by PHP automatically), but let the logged in user auto-save or manually-save the cart for a later date. Next time they log-in, the cart gets loaded from the DB, prices and availability get updated, and the user can continue.



Justin French


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to