Remove Country from Country Checkout List
-
Hey!
I recently tried to remove a country from the billing_country dropdown menu on checkout page by using the following code. Unfortunately, The code do not touch the “option value”, so that unfortunately the code does not remove the whole “option value” but really only the name of the country. Therefore I then have an empty entry in my dropdown menu.
But I just want to remove the complete entry including the country. Can somebody help me to remove a country conplettly?
add_filter( ‘woocommerce_countries’, ‘remove_gb’, 10, 1 );
function remove_gb( $country ) {
unset($country[“GB”]);
return $country;
}
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Remove Country from Country Checkout List’ is closed to new replies.