-
-
Save ofernandolopes/8cd60a8feddc5ac37d8e to your computer and use it in GitHub Desktop.
WooCommerce - Sell in specific States/Provinces/Regions
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
<?php | |
/** | |
* Sell only in Minas Gerais. Brazil | |
*/ | |
function wc_sell_only_states( $states ) { | |
$states['BR'] = array( | |
'MG' => __( 'Minas Gerais', 'woocommerce' ), | |
); | |
return $states; | |
} | |
add_filter( 'woocommerce_states', 'wc_sell_only_states' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment