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
// This function disables the Stripe gateway everywhere except for the order-pay endpoint. | |
// It also removes the Check gateway from the order-pay endpoint. | |
function ijab_selected_gateways_order_pay( $available_gateways ) { | |
if ( is_checkout() && ! is_wc_endpoint_url( 'order-pay' ) ) { | |
unset( $available_gateways[ 'stripe' ] ); | |
} | |
if ( is_checkout() && is_wc_endpoint_url( 'order-pay' ) ) { | |
unset( $available_gateways[ 'cheque' ] ); | |
} | |
return $available_gateways; | |
} | |
add_filter( 'woocommerce_available_payment_gateways', 'ijab_selected_gateways_order_pay' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment