Hide the place order button if no valid shipping methods and payments are found in WooCommerce

Hide the place order button if no valid shipping methods and payments are found in WooCommerce on child sites.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'woocommerce_order_button_html', 'remove_place_order_button' );
function remove_place_order_button( $button_html ) {
    if ( ! WC()->cart->needs_shipping() || ! WC()->cart->needs_payment() ) {
        $button_html = '';
    }
    return $button_html;
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.