default country for WP travel (booking) forms

Homepage Forums WP Travel default country for WP travel (booking) forms

This topic contains 5 replies, has 2 voices, and was last updated by  Support Team 5 months, 2 weeks ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #8432

    Emotion Services
    Participant

    This question has been answered in several questions from other users.
    The answers are pointing to https://gist.github.com/anonymous/d763dbd39ea993184afcaeb2461c44e3

    But when i enter the code from github in my function.php (child theme) it does not change the default value in the form

    #8433

    Support Team
    Keymaster

    Hello @emotion-services,

    Please refer to below given link to know how you can change the default country.

    http://wptravel.io/change-default-country-in-the-booking-form/

    Thank you.

    Regards!!

    #10066

    Emotion Services
    Participant

    The default country settings with the function does not work.

    i have put the function in my child theme but in the booking form the country is not set to NL (Nederland)

    develop website is on http://www.laptopvoorraad.nl there you can check the booking form

    #10075

    Support Team
    Keymaster

    Hello @emotion-services,

    The code provided above does not work for the recent version so please remove above-provided code and add the code given below:

    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 );

    Hope this helps.

    Regards!!

    #10095

    Emotion Services
    Participant

    Thanks this solves the issue.

    #10102

    Support Team
    Keymaster

    Hello @emotion-services,

    Glad we could help you 🙂 .

    If you have any issues further then please feel free to post them.

    Also, we would really appreciate if you could help us by dropping your valuable feedback in our plugin by following the link given below:

    https://wordpress.org/support/plugin/wp-travel/reviews

    Thank you.

    Best Regards!!

    Have a good day 🙂

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.