I am having two payment methods for Woocommerce shop, one is 'cod' and second is 'paypal'. I need to hide default "Place order button" when the user select Paypal payment method. I tried with the hook like below but it gets hiding for both payment methods.
add_filter('woocommerce_order_button_html', 'remove_order_button_html' );
function remove_order_button_html( $button ) {
// HERE define your targeted pay method
$payment_method = 'ppec_paypal';
$chosen_payment_method = WC()->session->get('chosen_payment_method');
if( $payment_method == $chosen_payment_method ){
$button = '';
return $button;
}
}