Add this snippet to the functions.php file of your theme to add a new country to the WooCommerce countries list.
add_filter('woocommerce_states', 'sa_woocommerce_states'); add_filter('woocommerce_countries_allowed_country_states','sa_woocommerce_state');
function SA_woocommerce_states( $states ) Add this snippet to the {functions.php
file of your theme to add a new country to the WooCommerce countries list.
add_filter('woocommerce_states', 'sa_woocommerce_states');
add_filter('woocommerce_countries_allowed_country_states','sa_woocommerce_state');
function SA_woocommerce_states( $states ) {
$states['ZA']['EC'] = __('Eastern Cape', 'woocommerce');
return $states;
}
}