Instantly share code, notes, and snippets.

Embed
What would you like to do?
WooCommerce - Disable payment method for currency
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