I am currently working on a marketplace but I cannot update the stocks when a new order is placed. I have 3 data types :
Products added by store owners.
2. Ordered product
This includes a single ‘product’ + additional fields (quantity etc). Created by users when they add a product to their baskets.
This includes a list of ‘Ordered products’ + additional fields
Basic workflow is :
1 A customer adds products to his basket
2 New ordered products are created and added to his current order
3 the customer pays and a new order is placed.
So, I have a list of ordered products in my cart, and each of them has its quantity. When the order is placed, I would like the quantity of each products from oredered products in the cart to be decreased by the amount of the ordered product quantity that contains current product.
It would be really cool if someone could help me, I’ve been stuck on this for several days. Thank you so much !