📅  最后修改于: 2022-03-11 14:57:03.199000             🧑  作者: Mango
function disable_checkout_button_no_shipping() {
$total = WC()->cart->get_cart_subtotal(); // Change made
if( $total < 15 ){
remove_action( 'woocommerce_proceed_to_checkout', 'woocommerce_button_proceed_to_checkout', 20 );
echo 'Proceed to checkout';
}
}
add_action( 'woocommerce_proceed_to_checkout', 'disable_checkout_button_no_shipping', 1 );