Created
May 28, 2021 19:06
-
-
Save InpsydeNiklas/1b463312453db0906462a857fedc1683 to your computer and use it in GitHub Desktop.
make PayPal Card Processing gateway default selection in the checkout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'template_redirect', 'define_default_payment_gateway' ); | |
function define_default_payment_gateway(){ | |
if( is_checkout() && ! is_wc_endpoint_url() ) { | |
$default_payment_id = 'ppcp-credit-card-gateway'; | |
WC()->session->set( 'chosen_payment_method', $default_payment_id ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment