📜  isable_checkout_button - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:03.199000             🧑  作者: Mango

代码示例1
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 );