Code-Snippets-Functions/Execute a function on a child site/WooCommerce/disable-checkout-country-fields.txt

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;
}