Forced Backorders on WooCoomerce, Multiple Orders are being placed for single stock item as the engine waits for payment feedback.

Just doing a quick write up on an issue I faced with a woo commerce store.

Essentially my store was tied up with third party payment gateways which redirects you out of the site when and order is placed to collect the payment.

So I kept getting forced backorders and mutliple orders for a single stock item, this is because traditionally woocoommerce doesnt reserve or hold stock of a product when an order is placed or is moved to the pending payment status, it only reduces stock once the payment confirmation is received.

This provides an interval and window for other users to order the same product with a single stock, which in turn forces a backorder.

In order to solve this, and I repeat happens during instance of using a third party IPG, we focused on reducing the stock on click of place order button or when the order status was changed to pending payment.

We were able to achieve this through this plugin https://wordpress.org/plugins/stock-triggers-for-woocommerce/, which is easy to used and setup.

I tried multiple hooks but this plugin made it way easier.