mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
https://stackoverflow.com/questions/65769425/disallow-customer-to-change-country-in-woocommerce-checkout
7 lines
338 B
Text
7 lines
338 B
Text
add_filter( 'woocommerce_checkout_fields', 'checkout_country_fields_disabled' );
|
|
function checkout_country_fields_disabled( $fields ) {
|
|
$fields['billing']['billing_country']['custom_attributes']['disabled'] = 'disabled';
|
|
$fields['billing']['shipping_country']['custom_attributes']['disabled'] = 'disabled';
|
|
|
|
return $fields;
|
|
}
|