Created
December 5, 2022 09:29
-
-
Save Sirvijver/1f9515188b7299e9ca7f6125ffcc5429 to your computer and use it in GitHub Desktop.
make PayPal Card Processing gateway default selection in the checkout
This file contains hidden or 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