0

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;
    }
}
Tom
  • 87
  • 1
  • 9
  • 1
    Does this answer your question? [Change Pay button on checkout based on Woocommerce chosen payment method](https://stackoverflow.com/questions/49405604/change-pay-button-on-checkout-based-on-woocommerce-chosen-payment-method) – 7uc1f3r Sep 07 '20 at 17:12
  • Actually , i need to remove the Default Place order button when Paypal is selected by the user, at the same time if 'cod' selected, then I need the default place order button......In that thread also, i found the same way, but adding JS to change the text based on selected method – Tom Sep 07 '20 at 17:19

0 Answers0