Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

How to Restrict Billing to a Particular Country in WooCommerce Checkout?

Would you like to limit billing to a single country for your store’s checkout page? If you’re running a store and want to customize the checkout process by simplifying the country selection, this code snippet is your solution! This piece of code modifies the country field dropdown to a specific country in the billing section on your checkout page.

function ts_checkout_fields_billing( $fields ) { 

    $fields['billing']['billing_country'] = array(
        'type'      => 'select',
        'label'     => __('Country', 'woocommerce'),
        'options'   => array('IN' => 'India')
    );

    return $fields; 
} 
add_filter( 'woocommerce_checkout_fields' , 'ts_checkout_fields_billing' );

Output

When the customer visits the checkout page, it will display only one country from the dropdown menu with one choice – in this case, ‘India’ as shown below.

How to Restrict Billing to a Particular Country in WooCommerce Checkout

Alternatively, you can also remove default value of country & state field in WooCommerce checkout , preventing it from being auto-populated.

Browse more in: Code Snippets, WooCommerce How Tos, WooCommerce Tutorials

Share It:

Subscribe
Notify of
0 Comments
Newest
Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x