Ok. So the situation:
Customer #1 adds the last product in stock to his cart but doesn't finish the order. Maybe he just leaves or maybe just browse the site for the other products.
Meanwhile Customer #2 adds the same product to the cart and purchases it.
Then the customer #1 returns to his cart and he can still see the product in the cart even if it isnt in stock anymore. He proceeds, purchases it and I have not valid order and the stock value of -1 in the backend.
This is really wrong and the site shouldn't allow to purchase the product what isnt available anymore.
I have found that it is the bug of Prestashop 1.7.
I have applied the fix from he github: https://github.com/PrestaShop/PrestaShop/pull/8478 , the class and controller overrides and now then the products isnt available, the error is displayed.
The problem was, than the button "Proceed to checkout" was still working. I have written some jquery, so if the error is displayed, it disables the button. http://prntscr.com/ibz283
Now there is one small problem left. If I remove that product the error should be hidden.
Then the proceed button will become active again with my jquery and the customer can finish his order.
At the moment, if I remove that product, the error remains so the proceed button stays disabled and the customer is stuck till he refreshes the page.
That should be fixed
I am looking for freelancers with the lowest rates