Created
January 24, 2018 12:44
-
-
Save grola/876a24d8e05775d32f0ec6547fa70f45 to your computer and use it in GitHub Desktop.
WooCommerce - Disable payment method for currency
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', 'studiowp_woocommerce_available_payment_gateways', 100 ); | |
function studiowp_woocommerce_available_payment_gateways( $gateways ) { | |
if ( is_checkout() ) { | |
if ( get_woocommerce_currency() == 'INR' ) { | |
unset( $gateways['paypal'] ); | |
} | |
if ( get_woocommerce_currency() == 'USD' ) { | |
unset( $gateways['instamojo'] ); | |
} | |
} | |
return $gateways; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment