Last active
April 19, 2023 09:43
-
-
Save InpsydeNiklas/5d93515761a5b4edb5dff26ed413ad16 to your computer and use it in GitHub Desktop.
Remove PayPal Payments from "change_payment_method" page for WooCommerce Subscription
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
<?php | |
function remove_paypal_payment_gateways_from_change_payment_endpoint( $available_gateways ) { | |
if ( is_wc_endpoint_url( 'order-pay' ) && isset( $_GET['change_payment_method'] ) ) { | |
unset( $available_gateways['ppcp-gateway'] ); | |
unset( $available_gateways['ppcp-credit-card-gateway'] ); | |
} | |
return $available_gateways; | |
} | |
add_filter( 'woocommerce_available_payment_gateways', 'remove_paypal_payment_gateways_from_change_payment_endpoint' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment