Created
May 2, 2019 12:41
-
-
Save deshabhishek007/46fe86c15c2296a11121cad8452768a0 to your computer and use it in GitHub Desktop.
WooCommerce Snippet to Disable Paypal for Indian Customers.
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_filter( 'woocommerce_available_payment_gateways', 'wpmudra_payment_gateway_disable_country' ); | |
function wpmudra_payment_gateway_disable_country( $available_gateways ) { | |
if ( is_admin() ) return $available_gateways; | |
if ( isset( $available_gateways['paypal'] ) && WC()->customer->get_billing_country() == 'IN' ) { | |
unset( $available_gateways['paypal'] ); | |
} | |
return $available_gateways; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment