Reputation: 105
I am currently working on an eCommerce website, but i need some advice regarding the stock management.
I want the shopping cart to work as follow:
i came up with 2 solutions but neither is reliable from my point of view:
as u can see both solution require lot of work.Is there a better way to implement my shopping cart.
Upvotes: 0
Views: 628
Reputation: 3209
I think a better way might be to only update if the user checks out and check stock on the product listing pages.
The downside being the following scenario:
You'll need to check stock at every point in this process and inform your users what's going on.
Tying up inventory by having a user placing it in their cart is a bad idea. If user A adds all of the available stock of one item to their cart, no one else can buy it until they either log out, or you log them out with some sort of timeout.
Upvotes: 3