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


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.

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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Josh 2 years ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!