Last active
August 29, 2015 14:13
-
-
Save elvinlee/3854c1be3746ff5b2181 to your computer and use it in GitHub Desktop.
WooCommerce: Disable BACS if Customer Checkout Country Out of Singapore
This file contains hidden or 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', 'bacs_disable_outside_singapore' ); | |
//Disable bacs if the country not in Singapore | |
function bacs_disable_outside_singapore( $available_gateways ) { | |
global $woocommerce; | |
if ( isset( $available_gateways['bacs'] ) && $woocommerce->customer->get_country() <> 'SG' ) { | |
unset( $available_gateways['bacs'] ); | |
} | |
return $available_gateways; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment