I am integrating WooCommerce with a third party inventory API. When the Place Order button is clicked, I hook into the woocommerce_review_order_before_submit hook.
Here I grab the SKU's of all the products in the cart and send them to the API for a quick inventory check. This is all working.
If the remote system returns that not enough inventory is present for any of the SKU's we need to stop the purchase.
Is there a way to stop processing the order from the woocommerce_review_order_before_submit hook?
If not what is the proper way to handle this scenario in WooCommerce?
Thanks