Forum Moderators: coopster

Message Too Old, No Replies

How to deal with real-time changes on product that happens

to be in a customer's shopping cart?

         

add more milk

10:02 pm on Apr 25, 2006 (gmt 0)

10+ Year Member



Hi all,

I'm currently building a website that allows merchants sell their gift certificates online. The merchants can create/modify/delete their gift certificates through the Admin in real time.

But the question is: How should I deal with the event when a merchant modifies his gift certificate while at the same time some customer happens to have it in his shopping cart?

If I let the changes go through in real time, the customer will get confused during the checkout after seeing the gift certificate changes for no apparent reason. Or, worse, he continues to checkout without realizing the changes and purchase the certificate only to complain and return it later when he finds out.

What's the best way to handle this?

Thanks.

eelixduppy

10:23 pm on Apr 25, 2006 (gmt 0)



Hello...

How do you have the items in peoples' shopping carts stored? (session, cookie, etc...)

add more milk

2:04 am on Apr 26, 2006 (gmt 0)

10+ Year Member



Righ now they are stored in session. Would it help?

Thanks,

chris

eelixduppy

2:49 am on Apr 26, 2006 (gmt 0)



No sessions wouldn't help because they cannot all be accessed at once to see if someone has an item in their shopping cart.

If i were you, i would create a mysql table with one column, the certificate identifier, that you place all items that are being updated into. So when a certificate is being changed, as soon as that site is reached, the item is put into the table. Then when it comes time for someone to checkout, you can have a function that checks to see if any of thier items are in that table of objects currently being modified, and if so, warn them about it being changed and maybe not allow them to get that at the time. Of course when the owner is finished modifying their certificate, then write a function that drops that row from the table so that certificate can be purchased again.

hope this helps

eelix

add more milk

9:56 pm on Apr 26, 2006 (gmt 0)

10+ Year Member



I got an idea! How about this:

I put all the gift cert info (e.g. gift cert id, description, face value, restrictions, etc) all into the shopping cart's session variables as soon as the customer clicks the "Add to Cart" button and use these session variables all the way to checkout and placing order.

That way, when the merchant makes changes on a gift certificate that happens to be in the shopping cart, the changes will not take affect on that gift certificate and confuse the customer since the session variables don't change.

What do you think? Do you see any problem with this approach?

Thanks.

chris

eelixduppy

10:48 pm on Apr 26, 2006 (gmt 0)



No, actually, i don't see any problems with this approach. As long as it works i think it is a good idea.

Good luck!

eelix

add more milk

4:06 pm on Apr 28, 2006 (gmt 0)

10+ Year Member



thanks! I'll give it a try.

chris