Forum Moderators: coopster
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.
How do you have the items in peoples' shopping carts stored? (session, cookie, etc...)
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
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
Good luck!
eelix