结账页国家排序
//结账页国家排序
add_filter( 'woocommerce_countries_allowed_countries', 'sdf_countries_order', 99999, 1 );
function sdf_countries_order( $countries ) {
$new_countries_array = array(
"US"=> "United States (US)",
"DE"=> "Germany",
"FR"=> "France",
"ES"=> "Spain",
"IT"=> "Italy",
"NL"=> "Netherlands",
"CA"=> "Canada",
"PL"=> "Poland",
"DK"=> "Denmark",
"GR"=> "Greece",
"PT"=> "Portugal",
"FI"=> "Finland",
"SE"=> "Sweden",
"CH"=> "Switzerland",
"BG"=> "Bulgaria",
"HR"=> "Croatia",
"HU"=> "Hungary",
"CZ"=> "Czech Republic",
"SK"=> "Slovakia"
);
$new_countries = array_merge($new_countries_array,$countries);
return $new_countries;
}
© 版权声明
THE END