jezuit azus
jezuit azus

Reputation: 161

Woocommerce - Remove country field in cart shipping

How would I have Australia selected by default and have the input field not displaying heres an example of what im talking about I am using woocommerce:

enter image description here

I'm sure there is a simple function for this or setting in the back end but can't seem to find a solution :(

Upvotes: 5

Views: 30385

Answers (5)

Ricardo Ferrari
Ricardo Ferrari

Reputation: 1

Set your store to only sell to Specific Countries in the WooCommerce Settings> General Settings in the "Specific Countries" field and hide the woocommerce billing contry field using CSS:

#billing_country_field {display:none;}

Upvotes: 0

Everaldo Neves
Everaldo Neves

Reputation: 1

// insert into functions.php your theme. Resolved!

add_filter( 'woocommerce_shipping_calculator_enable_country', '__return_false' );
add_filter( 'woocommerce_shipping_calculator_enable_city', '__return_false' );
add_filter( 'woocommerce_shipping_calculator_enable_state', '__return_false' );

Upvotes: 0

Alexey Svidentsov
Alexey Svidentsov

Reputation: 537

A bit late but still for those who looking for correct answer

// Remove Country field from shipping calculator
add_filter('woocommerce_shipping_calculator_enable_country','__return_false');

Upvotes: -3

Ashish Patel
Ashish Patel

Reputation: 3634

Paste following code into your function.php file to Remove country field in checkout page:

function custom_override_checkout_fields( $fields )    
{
unset($fields['billing']['billing_country']);
return $fields;
}
add_filter('woocommerce_checkout_fields','custom_override_checkout_fields');

Upvotes: 6

helgatheviking
helgatheviking

Reputation: 26329

You can set your store to only sell to Australia in the WooCommerce Settings> General Settings in the "Specific Countries" field

restrict the countries you will sell to

This should remove the Country option from the checkout. With "Australia" set in the above settings here is the result in Twenty Fourteen:

checkout with no country option

Upvotes: 7

Related Questions