Search Documentation

WP Travel User Documentation

  1. Home
  2. Docs
  3. WP Travel User Documentation
  4. Support Queries
  5. How to change default country in form field?

How to change default country in form field?

If you would like to change the default country in the final booking form field you can add below given code in your child theme functions.php file. To know how to create the child theme please refer to below given link: 

Child Theme  

After creating the child theme in your child theme functions.php file add below given code.

function wp_travel_customize_booking_form($fields) {

	$fields['traveller_fields']['country']['default'] = 'NL';
	$fields['billing_fields']['country']['default'] = 'NL';
 
	return $fields;
 }
 
 add_filter( 'wp_travel_checkout_fields', 'wp_travel_customize_booking_form', 99 );

You need to replace ‘NL‘ country code with your country code in above given code.

Was this article helpful to you? Yes No

How can we help?