Support

Home Forums Event Espresso Premium Set default country at top of list

Set default country at top of list

Posted: March 27, 2018 at 8:52 pm

Viewing 1 reply thread


jbabagmsc

March 27, 2018 at 8:52 pm

We need to have a list of countries available on checkout, but the vast majority of attendees will be from the U.S. Where might I find an option to move United States to the top of the list as the default country?


Josh

  • Support Staff

March 28, 2018 at 8:45 am

Hi there,

While there are no options for setting a default country, you can add a bit of code to your site that will change the default country to US:

add_action(
 'wp_enqueue_scripts', 
 'my_change_default_ee_country_option',  
    20
);
function my_change_default_ee_country_option(){
 $custom_js = 'jQuery(document).ready(function($){';
 $custom_js .= '$(".ee-reg-qstn-country").val("US");';
 $custom_js .= '});';
    wp_add_inline_script('ee_form_section_validation', $custom_js);
}

You can add the above to a functions plugin or into your WordPress theme’s functions.php file.

Viewing 1 reply thread

The support post ‘Set default country at top of list’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso