We replace the function _checkProducts by checkProductsQuantity.
We do not change the main logic:
Orders coming from marketplace will always be created regardless of the stock
The stock will be increased if we do not have enough stock (otherwise PrestaShop may deny the order)
What changed however:
We now rely on PrestaShop quantities settings (whether to allow or not order creation when the product is out of stock) and upgrade product quantities accordingly. Meaning that if settings allow order creation when out of stock, we will not upgrade the stock.
We are now supporting advanced stock management when updating the quantities. (An a stock movement is created).
Fixes #349
Changes made
We replace the function
_checkProducts
bycheckProductsQuantity
.We do not change the main logic:
What changed however: