add_action( 'woocommerce_before_checkout_form', 'es_checkout_add_cart_notice' ); function es_checkout_add_cart_notice() { $message = "You have a backorder product in your cart."; if ( es_check_cart_has_backorder_product() ) wc_add_notice( $message, 'error' ); } function es_check_cart_has_backorder_product() { foreach( WC()->cart->get_cart() as $cart_item_key => $values ) { $cart_product = wc_get_product( $values['data']->get_id() ); if( $cart_product->is_on_backorder() ) return true; } return false; } Home & Garden > Decor > Door Mats Archives - VillaJipp
X