At the moment, if an item is out of stock a message appears in the checkout page:
Sorry, we do not have enough "xxx" in stock to fulfil your order (2 available). We apologise for any inconvenience caused.
Hence If that message appears, then I want to disable the "Proceed to checkout" button on the page by simply removing it.
If it that message doesn't appear, then display the "Proceed to checkout" button.
I'll obviously create an IF statement so that if it's true then display if not, don't display etc.
Here's my "Proceed to checkout" button code:
<input type="submit" name="cart_submit" class="checkout-button button alt wc-forward" style="text-transform: capitalize;" value="<?php esc_html_e( 'Proceed to checkout', 'woocommerce' ); ?>" />
So is there a method that I can call in Woocommerce to see if that error message has been called?
I tried scanning the entire webpage for that message and if true, execute xyz but that didn't work (could be sessions).
Any help would greatly be appreciated.