I am working on an e-commerce project and I would like to set up 2 dropdown lists linked in ajax. The first list contains the products and the second one contains the quantity of each product.
There is a problem when a user selects a product and then a quantity, and, in the same time another user selects a product and then a quantity => the quantities are not correct. I will try to explain what I mean.
Imagine a first product named "A" with 2 quantities. A first user choses this product and selects 1 quantity. there is one quantity left for this product. At this same very moment, if another user selects the same product, the quantities show "2" ! It is difficult to explain but I wonder if a timeout function should fix this.