Add store locale to allowed country list in WooCommerce's Stripe plugin which whitelists countries since 4.5.1
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
function moso_add_country_to_stripe( $countries ) { | |
$wc_default_country = substr( get_option( 'woocommerce_default_country' ), 0, 2 ); | |
if ( ! in_array( $wc_default_country, $countries ) ) { | |
$countries[] = $wc_default_country; | |
} | |
return $countries; | |
} | |
add_filter('wc_stripe_supported_countries', 'moso_add_country_to_stripe'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment