I'm currently working on an onlne ordering system. I created a shopping cart using session variables, and the inventory is in an sql db. I'm trying to work out how to track the quantity in the database. For instance, I need to know how many of any given item are in the cart of person X, so that person Y knows that there aren't as many pieces available.
I was thinking that I could add a second quantity field in the db, with how many items are pending in people's carts, but the carts get destroyed when the session gets destroyed, and I would have to have some way of knowing that the session ended without ordering so that I could modify the pending quantity.
I've been thinking/working/researching on this for a while now, and I think I'm pretty well stumped. Insight greatly appreciated.
I was thinking that I could add a second quantity field in the db, with how many items are pending in people's carts, but the carts get destroyed when the session gets destroyed, and I would have to have some way of knowing that the session ended without ordering so that I could modify the pending quantity.
I've been thinking/working/researching on this for a while now, and I think I'm pretty well stumped. Insight greatly appreciated.