Disable payment gateway based on billing address
-
The code below successfully allows me to disable certain payment gateway, but I will like to ask how I can add other countries to the code. Thanks.
function payment_gateway_disable_country( $available_gateways ) {
global $woocommerce;
if ( is_admin() ) return;
if ( isset( $available_gateways[‘stripe’] ) && $woocommerce->customer->get_billing_country() <> ‘US’ ) {
unset( $available_gateways[‘stripe’] );
}
return $available_gateways;
}add_filter( ‘woocommerce_available_payment_gateways’, ‘payment_gateway_disable_country’ );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Disable payment gateway based on billing address’ is closed to new replies.