- This topic has 16 replies, 6 voices, and was last updated 3 years, 10 months ago by
Support Team.
- AuthorPosts
- May 27, 2019 at 11:49 am #16305
lorraine@creativeimagineering.co.za
ParticipantHi,
On the booking form my default country is Afghanistan, how do I change this?May 27, 2019 at 12:01 pm #16308wensolutions
KeymasterHello,
To change the default country in the booking field, please follow below given link:
https://wptravel.io/change-default-country-in-the-booking-form/
Hope this helps.
If you have any query/confusion further then please let us know.
Thank you.
June 17, 2019 at 1:11 pm #16924paulo232
ParticipantHave tried the above code, still stuck on Afghanistan?
June 18, 2019 at 4:53 am #16943Support Team
KeymasterHello @paulo232,
When we tested the code, we found that the code is working absolutely fine as you can see in the screenrecord below:
https://www.loom.com/share/f134b2a719c348639169abb3eed18a2a
So make sure you have added the correct code.
Hope this helps.
Thank you.
June 20, 2019 at 8:20 am #17025paulo232
ParticipantThis is the code we have added from the article we read, we just changed to UK so it defaults to United Kingdom but when we use site its still stuck on Afghanistan?
function wp_travel_customize_booking_form($fields) {
$fields[‘traveller_fields’][‘country’][‘default’] = ‘UK’;
$fields[‘billing_fields’][‘country’][‘default’] = ‘UK’;return $fields;
}add_filter( ‘wp_travel_checkout_fields’, ‘wp_travel_customize_booking_form’, 99 );
June 20, 2019 at 10:08 am #17028lorraine@creativeimagineering.co.za
ParticipantHi,
I used the SNIPPETS PLUGIN and added the second block in the link mentioned by WEN Sulutions https://wptravel.io/change-default-country-in-the-booking-form/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 );
**Make sure you use the correct country code 🙂 ** I think country code for United Kingdom is GB
June 20, 2019 at 11:39 am #17043wensolutions
KeymasterHello @lorrainecreativeimagineering-cp-za,
Thank you very much for your help 🙂 .
Hello @paulo232,
Since there are two blocks of code, the lower one work in the latest version of the theme. So please verify properly. If the problem still persists kindly let us know.
Thank you.
July 31, 2019 at 11:35 am #18427mashaku
ParticipantHello, I also have a problem with default country
In my site there is a previous booking form without cart process.
I tried to add both code provide above, but it does not works
Now the code is
/*Change default country in the Booking form*/
function wp_travel_customize_booking_form($fields) {$fields[‘country’][‘default’] = ‘ES’;
return $fields;
}
add_filter( ‘wp_travel_booking_form_fields’, ‘wp_travel_customize_booking_form’, 99 );
July 31, 2019 at 12:13 pm #18431Support Team
KeymasterHello @mashakhu,
Can you please mention the WP Travel version that you are currently using so that we can help you further?
Thank you.
July 31, 2019 at 12:17 pm #18432mashaku
ParticipantJust upgrade up to 2.0.9
August 1, 2019 at 4:04 am #18447Support Team
KeymasterHello @mashakhu,
Please refer to below-given link to change the default country in the form.
https://wptravel.io/change-default-country-in-the-booking-form/
Hope this helps.
Thank you.
August 1, 2019 at 8:03 am #18452mashaku
ParticipantYou send me the link to this topic. As I’ve told you I already tried both code, but nothing change
Now I add the second one
/*Change default country in the Booking form*/
function wp_travel_customize_booking_form($fields) {$fields[‘traveller_fields’][‘country’][‘default’] = ‘UK’;
$fields[‘billing_fields’][‘country’][‘default’] = ‘UK’;return $fields;
}add_filter( ‘wp_travel_checkout_fields’, ‘wp_travel_customize_booking_form’, 99 );
Still doesn’t work 🙁
Screen below
http://prntscr.com/omumd3August 1, 2019 at 8:51 am #18454Support Team
KeymasterHello @mashakhu,
While we have tested the given snippet of code with default themes like TwentyNinteen and compatible themes with WP Travel plugin which seems to work perfectly fine.
Compatible themes link:
https://wptravel.io/wordpress-travel-themes/So we are not sure what’s causing the conflict with the provided code-tweak.
Unfortunately, there’s a difference between the support we can offer and the level of programming needed to change (core) features of our plugin. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make further changes. And even though we cannot be of any assistance, you’re completely free to change anything in the plugin to better suit your needs.
We highly recommend checking out available freelance WordPress developers or hire our customizers to look into the issue specific to your setup.
To hire a customizer refer to below-given link:
https://wptravel.io/hire-our-customizer/We hope that you understand this concern.
Thank you.
August 1, 2019 at 9:55 am #18455mashaku
ParticipantIt´s very pity to hear it.
Because I only use our theme and your plugin. And nobody knows it´s better then the developers.
All the customization being done in the web site was made by yours programmer
If you can´t advise me how can I change the default company, can you tell me how can I disable this field
RegardsAugust 1, 2019 at 12:12 pm #18460Support Team
KeymasterHello @mashaku,
Thank you, your concerns are valid.
There might be several other reasons why given snippet might not work:
1. Due to conflict with other 3rd-party plugins that exist in your setup. You should check this by disabling all other plugins.
2. Snippet generally to be paste in functions.php of your theme file so make sure you have properly added the provide code in your child theme’s fucntions.php file.
3. Check the error log for any error thrown.
Let us know if the above mention steps work or not?
Thank you.
- AuthorPosts
- The forum ‘WP Travel’ is closed to new topics and replies.