Disable checkout country dropdown fields in WooCommerce

Disable checkout country dropdown fields in WooCommerce on your child site.

Snippet Type

Execute on Child Sites

Snippet

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

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.