Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to determine if shopping cart has been abandoned?

11 views
Skip to first unread message

Chris W. Parker

unread,
Dec 4, 2003, 4:09:57 PM12/4/03
to php-g...@lists.php.net
Hey there everyone.

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

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

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?

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.

WHAT TO DO?

A BIT CONFUSED I AM!

Thanks,
Chris.

Anas Mughal

unread,
Dec 4, 2003, 4:22:50 PM12/4/03
to Chris W. Parker, php-g...@lists.php.net
This looks like a business decision.
Your business anaylist could help answer your question.

Chris W. Parker wrote:

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

Eric Wood

unread,
Dec 4, 2003, 4:22:25 PM12/4/03
to php-g...@lists.php.net
Chris W. Parker wrote:
> 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

Well, you don't what item to linger too long as prices change. If a user
add something to their cart and comes back days later, there may be a
different price or the item may have been discontinued, etc.. So you user
may end up getting the wrong price unless you have checkout logic to correct
pricing.

I say, if an incomplete cart hasn't been touched more than 2 hours *and* you
do cleanup processing at 3:00am, then that'll be safe enough, especially if
you have few international orders.
-Eric Wood

Jay Blanchard

unread,
Dec 4, 2003, 4:24:55 PM12/4/03
to Chris W. Parker, php-g...@lists.php.net
[snip]
...ton's o thoughts
[/snip]

I am making an assumption that you are using sessions for your shoppers.
If this is the case then the cart would be abandoned if/when the session
expires. If you are not using sessions then I think 24 hours would be on
the longish side of acceptable.

In another thread on another list I pointed out to another person
designing a cart that the items in the cart are removed from inventory
while they are in the cart even though no check-out has occured. If the
cart is abandoned I want to return those items to the shelf as quickly
as possible, making them available for other shoppers. A lot of folks
get this wrong IMHO...they do not remove the item from inventory when it
is placed in the cart, they do it at check-out. This could cause
concerns if the items in question are popular.

Richard Davey

unread,
Dec 4, 2003, 4:20:36 PM12/4/03
to Chris W. Parker, php-g...@lists.php.net
Hello Chris,

Thursday, December 4, 2003, 9:09:57 PM, you wrote:

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

Not that it answers all of your questions - but Amazon persist your
shopping basket for AGES. Infact I do wonder if it ever times out,
I've known them last a few months before.

Mind you - that's because they knew who I was.

You ought to group your baskets into "anonymous" and "owned". Keep the
owned ones for weeks, if not months, and the anonymous ones shorter.
1 week at the most?

--
Best regards,
Richard mailto:ri...@launchcode.co.uk

Justin French

unread,
Dec 4, 2003, 5:20:02 PM12/4/03
to Chris W. Parker, php-g...@lists.php.net
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

Chris W. Parker

unread,
Dec 4, 2003, 5:31:02 PM12/4/03
to php-g...@lists.php.net
Jay Blanchard <mailto:jay.bl...@niicommunications.com>

on Thursday, December 04, 2003 1:25 PM said:

> In another thread on another list I pointed out to another person
> designing a cart that the items in the cart are removed from inventory
> while they are in the cart even though no check-out has occured. If
> the cart is abandoned I want to return those items to the shelf as
> quickly as possible, making them available for other shoppers. A lot
> of folks get this wrong IMHO...they do not remove the item from
> inventory when it is placed in the cart, they do it at check-out.
> This could cause concerns if the items in question are popular.

I brought up this same issue recently with some coworkers and everyone
(except me) thought it would be a good idea to do it at checkout. I took
your approach which is to remove it when the customer "takes it off the
shelf" so to speak.

Would it be too complicated to say "5 in inventory, 2 of those are in
customer shopping carts"? Or something along those lines?

Chris.

p.s. Does anyone know of any mailing lists that deal with e-commerce and
shopping cart design (code/implementation/logic/etc.)???
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

Chris W. Parker

unread,
Dec 4, 2003, 5:35:30 PM12/4/03
to php-g...@lists.php.net
Justin French <mailto:jus...@indent.com.au>

on Thursday, December 04, 2003 2:20 PM said:

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

<slaps_forehead/>

;)

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

That is an excellent idea and one that I hadn't thought of.

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

Yeah the session files are cleaned up automatically but your application
doesn't know that. You'd have to specifically tell your application (via
a cron job??) when the session get cleaned up and that it (the
application) should remove all the old carts.

Is there something I don't know about (very possible!)? I mean, even if
the users session file is deleted, how do you tell the app. to follow
suit and delete it's ASIDE from setting a cron job?

Chris.

Robert Cummings

unread,
Dec 4, 2003, 5:15:44 PM12/4/03
to Eric Wood, PHP-General

Since the shopping cart hasn't been checked out, couldn't the shopping
cart just keep track of inventory IDs and quantity, and finalize price
at checkout time. Thus the prices would be up-to-date even if the user
returned 5 months later. This could also handle products no longer
carried, since hte ID would become invalid and it could automatically be
removed form the shopping cart when the user reconnects. Chances are
after 5 months they don't remember what they ordered anyways.

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

Chris W. Parker

unread,
Dec 4, 2003, 5:27:25 PM12/4/03
to Anas Mughal, php-g...@lists.php.net
Anas Mughal <mailto:am...@optonline.net>

on Thursday, December 04, 2003 1:23 PM said:

> This looks like a business decision.
> Your business anaylist could help answer your question.

Yes, and so far they've all given good ideas.

Thanks.

Justin French

unread,
Dec 4, 2003, 5:48:26 PM12/4/03
to Chris W. Parker, php-g...@lists.php.net
On Friday, December 5, 2003, at 09:35 AM, Chris W. Parker wrote:

> Yeah the session files are cleaned up automatically but your
> application
> doesn't know that. You'd have to specifically tell your application
> (via
> a cron job??) when the session get cleaned up and that it (the
> application) should remove all the old carts.
>
> Is there something I don't know about (very possible!)? I mean, even if
> the users session file is deleted, how do you tell the app. to follow
> suit and delete it's ASIDE from setting a cron job?

Rather than storing the shopping cart in a DB, store the cart in the
session. When the session dies, so does the cart.
When/if they choose to save it, it THEN gets ported into a database.

Justin French

Chris W. Parker

unread,
Dec 4, 2003, 6:10:44 PM12/4/03
to php-g...@lists.php.net
Justin French <mailto:jus...@indent.com.au>

on Thursday, December 04, 2003 2:48 PM said:

> Rather than storing the shopping cart in a DB, store the cart in the
> session. When the session dies, so does the cart.
> When/if they choose to save it, it THEN gets ported into a database.

Aaahhhhh...! This makes sense.

Thanks,

Justin Patrin

unread,
Dec 4, 2003, 5:29:39 PM12/4/03
to php-g...@lists.php.net
Of course, this makes problems when you're adding promotional product to
the cart, which should have a seperate price. Add to this that the
customer may have special pricing (think Business to Business). So you
have to have an update mechanism for promotions and the extra price
lists. Do-able, but it can get hairy.

Jon Bennett

unread,
Dec 4, 2003, 8:12:49 PM12/4/03
to php-g...@lists.php.net
why not only reduce the stock once a sale has gone through ???

Cheers,

Jon


jon bennett | j...@jben.net
new media designer / developer
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

J b e n . n e t

91 Gloucester Rd, Trowbridge, Wilts, BA14 0AD
t: +44 (0) 1225 341039 w: http://www.jben.net/


On 5 Dec 2003, at 01:09, Justin Patrin wrote:

> Of course, now you have to deal with putting inventory back on the
> shelf when the session expires....and you have no way of knowing when
> that would happen unless you're storing *something*.

Justin Patrin

unread,
Dec 4, 2003, 8:09:38 PM12/4/03
to php-g...@lists.php.net
Of course, now you have to deal with putting inventory back on the shelf
when the session expires....and you have no way of knowing when that
would happen unless you're storing *something*.

Justin French

unread,
Dec 4, 2003, 8:26:08 PM12/4/03
to Justin Patrin, php-g...@lists.php.net
On Friday, December 5, 2003, at 12:09 PM, Justin Patrin wrote:

> Of course, now you have to deal with putting inventory back on the
> shelf when the session expires....and you have no way of knowing when
> that would happen unless you're storing *something*.

A good point, if that's the way he wants to do things...

In which case, SC needs to be stored SOMEWHERE (DB), and a cron job
garbage cleanout could take place every 1/15/30/60 minutes to remove
SC's without matching sessions, or something similar.

Justin

Jay Blanchard

unread,
Dec 5, 2003, 7:38:19 AM12/5/03
to Justin French, Justin Patrin, php-g...@lists.php.net
[snip]

> Of course, now you have to deal with putting inventory back on the
> shelf when the session expires....and you have no way of knowing when
> that would happen unless you're storing *something*.

A good point, if that's the way he wants to do things...

In which case, SC needs to be stored SOMEWHERE (DB), and a cron job
garbage cleanout could take place every 1/15/30/60 minutes to remove
SC's without matching sessions, or something similar.

[/snip]

How about a session identified limbo table?

David T-G

unread,
Dec 5, 2003, 8:40:49 AM12/5/03
to PHP General list, Chris W. Parker
Chris, et al --

...and then Chris W. Parker said...
%
...
%
% Would it be too complicated to say "5 in inventory, 2 of those are in
% customer shopping carts"? Or something along those lines?

I shouldn't think so; it would be a bit of extra work, but not a big
deal. If you did, then I'd have a notice somewhere that an item in an
old cart might get sold out from under the buyer (especially if there's
any real or implied guarantee of availability).

I would imagine that Amazon, from another example, has at least this
level or perhaps even doesn't note the stock as "gone". Surely it would
kill them if I ordered 432 copies of my buddy's book, waited until they
said that they had stock again, and then repeated the process.


%
% Chris.
%
% p.s. Does anyone know of any mailing lists that deal with e-commerce and
% shopping cart design (code/implementation/logic/etc.)???

I don't, but if you find one I'd be interested.


HTH & HAND

:-D
--
David T-G * There is too much animal courage in
(play) dav...@justpickone.org * society and not sufficient moral courage.
(work) david...@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

David T-G

unread,
Dec 5, 2003, 8:37:22 AM12/5/03
to PHP General list, Chris W. Parker
Chris, et al --

...and then Chris W. Parker said...
%

% Hey there everyone.

Hiya!


%
...
% How do you determine if a shopping cart has been abandoned or not?
...
%
% 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.

If you go with the ideas of keeping the cart in a session (and not
decrementing the stock until purchase time) then it's easy; when the
session goes away the cart does and it's abandoned. Have a simple table
of all carts created or even a counter of carts and reference that
against completed carts to get your ratio.

If you go with the ideas of storing the cart in the DB, then either
implement the simple table above for your count as carts get deleted
or just add an 'abandoned' field and keep the cart forever or perhaps
combine the two and note old carts that are due to be wiped as such and
include that analysis in the math against the cart_total_count table.

Daniel Guerrier

unread,
Dec 11, 2003, 12:07:51 PM12/11/03
to Chris W. Parker, php-g...@lists.php.net
Why not just maintain carts for users with accounts
and maintain them indefinately. Users with out
accounts can have there carts stored in a session and
will become invalid when the session expires.
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

jeremy.ch...@foxmetrics.com

unread,
Dec 19, 2015, 2:59:59 PM12/19/15
to
Anyone know where i can find groups with these topics that are recent?

--


Disclaimer The information in this email and any attachments may contain
proprietary and confidential information that is intended for the
addressee(s) only. If you are not the intended recipient, you are hereby
notified that any disclosure, copying, distribution, retention or use of
the contents of this information is prohibited. When addressed to our
clients or vendors, any information contained in this e-mail or any
attachments is subject to the terms and conditions in any governing
contract. If you have received this e-mail in error, please immediately
contact the sender and delete the e-mail.
0 new messages