You have ordered one item and placed it into your cart. Let's say you
ordered one small black t-shirt. Your cart will have the product_id,
color_id and size_id for the small black t-shirt. The quantity of this item
is, let's say 30. You have one in your cart, so how many are available:
1) 29
2) 30
Now let's say that while I ordered one small black t-shirt, Sven ordered 1
small black t-shirt, Anders ordered one black t-shirt, and Olov ordered one
black t-shirt. If all four of us, at one time, are all ordering the same
item and putting it into our carts, how many should there be available to
us:
1) 26
2) 25
3) 29
4) 30
This is where the contention comes in. The client wants it done "FIFO"
(First In First Out) meaning that whoever gets it first will subtract the
quantity - but I dispute that (coming from somewhat of a Java background)
that since PHP doesn't so single-threading, that means that all four of us
could order t-shirts, but the quantity has to reflect that all four of us
are ordering (multi-threading).
I dunno, help!
Phil
ordered one small black t-shirt. Your cart will have the product_id,
color_id and size_id for the small black t-shirt. The quantity of this item
is, let's say 30. You have one in your cart, so how many are available:
1) 29
2) 30
Now let's say that while I ordered one small black t-shirt, Sven ordered 1
small black t-shirt, Anders ordered one black t-shirt, and Olov ordered one
black t-shirt. If all four of us, at one time, are all ordering the same
item and putting it into our carts, how many should there be available to
us:
1) 26
2) 25
3) 29
4) 30
This is where the contention comes in. The client wants it done "FIFO"
(First In First Out) meaning that whoever gets it first will subtract the
quantity - but I dispute that (coming from somewhat of a Java background)
that since PHP doesn't so single-threading, that means that all four of us
could order t-shirts, but the quantity has to reflect that all four of us
are ordering (multi-threading).
I dunno, help!
Phil
Comment