How to disable the “Proceed to Checkout” button if there are errors in the cart

If you are using Dynamic Rules such as “Minimum Order” and would like to prevent the user from clicking “Proceed to Checkout” when there are errors in the cart, you can add the following JavaScript snippet to your website.

jQuery('body.woocommerce-cart').on('click', '.wc-proceed-to-checkout', function(event){
    if (jQuery('.woocommerce-error').length > 0) {

Powered by BetterDocs