Persistent Shopping Cart

635 views
Skip to first unread message

Vincy

unread,
Jul 14, 2008, 6:59:47 AM7/14/08
to ATG_Tech
Hi All,

I have a rather small doubt. I am doing a simple B2CCommerce project
using JBoss and Oracle. Below is a situation i am facing.

When an anonymous user visits a site and add products to the cart, it
is copied to the profile, if the user logs in. But when a user is
logged in and adds products to the cart and logs out, the shopping
cart is lost when he logs back in.

By default ShoppingCart.persistOrders is true. So my question is, Is
there is situation in which the ShoppingCart.persistOrders becomes
false, without specifying so in the property file.?
Or is there some other file in which i have to specify that my order
should persist even if i have logged out?

Any idea?

Thanks and Regards
Vincy

Message has been deleted

Vincy

unread,
Jul 14, 2008, 8:17:09 AM7/14/08
to ATG_Tech
Hi Aniket,

Can you clarify a little more? Beacusei tried the same but the result
is similar. The shopping cart is lost.

Thanks
Vincy


On Jul 14, 4:43 pm, Aniket <aniket.bhatna...@gmail.com> wrote:
> You should also enable ATG's session backup. Look into ATG
> documentation for more information. Basically, all you need to do is
> configure /atg/dynamo/Configuration component.

O'Brien, Paul

unread,
Jul 14, 2008, 1:27:00 PM7/14/08
to atg_...@googlegroups.com
Specifying persistOrders=true should result in the persisting of all orders for registered users, as soon as the order is created. I don't know why it wouldn't be persisting your orders. Is there anything written to the database for these orders? Is the problem that it's not persisted, or not retrieved when the user returns?

Aniket

unread,
Jul 14, 2008, 11:41:48 PM7/14/08
to ATG_Tech
Hi Vincy,

Here is what I suggest:

1) Login to your site and add some items to cart. Verify that these
items are getting stored with the order (You might use ACC to lookup
the order from its OrderId for this).

2) If the order is getting persisted, all you need to do is recover
session scoped shopping cart component using session recovery. Try
adding '/atg/commerce/ShoppingCart.current'
sessionBackupServerPropertyList of /atg/dynamo/Configuration component
and it should persist your shopping cart too.

Hope it helps.

Thanks,
Aniket

Matt Landau

unread,
Jul 15, 2008, 3:21:35 PM7/15/08
to ATG_Tech
Session backup has absolutely NOTHING to do with restoring the cart of
a registered user when they log into the site again.

Vincy

unread,
Jul 16, 2008, 2:25:08 AM7/16/08
to ATG_Tech
Hi All,

Thank you all for the reply.

Paul, I checked what you suggested and i found out the below:

1. If a product the added to the cart, the details regarding this is
not written into the DB. This is true for both an anonymous user and a
registered user.
2. I checked by displaying the order id and profile id of the order in
the cart page. Both are present, but nothing is reflected in the DB
nor can i find anything in the ACC.
3. So where does these details come from?
4. The order is lost when a user logs out. So what happens to the
order and the product added to the order?

Please can anyone suggest why this happening.

Thanks
Vincy

Tara

unread,
Jul 16, 2008, 5:47:58 AM7/16/08
to atg_...@googlegroups.com
Hello Vincy,

Orders in the shopping cart persists as long as the session is valid. Once you logout the session is lost with the orders. If you want the orders to persist then you should save them before you logout. This can be done by using

/atg/commerce/order/purchase/SaveOrderFormHandler

You can find more information regarding this on the ATG manuals

ATG/manuals/commprog/index.html?tW=300&tD=toc.html&mD=commprog1005.html

ATG/manuals/bcommref/index.html?tW=300&tD=toc.html&mD=bcommref0605.html

Hope this helps.

Regards,
-T

Matt Landau

unread,
Jul 16, 2008, 8:09:04 AM7/16/08
to ATG_Tech
There is considerable misinformation floating around this thread for
reasons I don't understand.

Orders are not supposed to be lost when a logged in user's session
expires. If the user is logged in the order should be saved /
automatically/ upon every modification (at least if you're using the
out of the box form handlers and configuration) and should be restored
on the next login, again /automatically/ (and again, if you're using
the out of the box form handlers and configuration).

Session backup and restore has nothing to do with it. The
SaveOrderFormHandler has nothing to do with it. The documentation
should be very clear about all of this, but if it's not -- if people
are getting the wrong ideas from the doc -- then please file doc bugs
pointing to the sections that are leading you to wrong conclusions.

As for debugging the OP's problem, the first thing to do is check the
Dynamo warning and error logs and make sure that there's not an
exception being thrown somewhere that causes the transaction to roll
back, which would lose the changes to the order. You might also want
to turn on loggingDebug on the OrderManager to make sure updateOrder
is being called correctly, and perhaps turn on loggingSQLDebug on the
order repository to monitor the SQL being used to try to update the
order.

Vincy

unread,
Jul 17, 2008, 8:19:12 AM7/17/08
to ATG_Tech
Hi All,

Thanks Matt for the info.

I tried to Debug but all to no result. No errors or warnings.

But then i tried with removing property files from config one at a
time.
And in the end, the problem was in ProfileFormHandler.properties. Once
i removed it, the persistence worked.

There is only one method written to validate the registration process
handleCreate().
The problem was in the helper class. It was extending the
GenericFormHandler. Once i removed that everything is working.

Thank you all for replying.

Matt, from this thread we found out what all was needed and not needed
and what can be done to debug the issue. Thank you :)

Thanks and Regards
Vincy
Reply all
Reply to author
Forward
0 new messages