Support

Home Forums Event Espresso Premium order of countries in dropdown selector

order of countries in dropdown selector

Posted: January 20, 2016 at 11:43 am


Loudbaby

January 20, 2016 at 11:43 am

Hello – is there a way to configure the display order of countries in the dropdown selector? Client would like to see the home country of their event displayed first. Since the vast majority of customers will be choosing that country, it feels like a sensible user experience request.

Suggestions?
thx!


Loudbaby

January 20, 2016 at 11:50 am

Or an even better solution could be to have the primary country already automatically selected from the list. 🙂


Josh

  • Support Staff

January 20, 2016 at 12:14 pm

Hi there,

You can change the order of the countries in the dropdown selector by adding a bit of jQuery to the bottom of the main registration page. The following example shows how to move the 3rd country option to the top of the list:

jQuery(document).ready(function($){
	var options = $('.ee-reg-qstn-country option'); 
	$( options[ 3 ] ).insertAfter( $(options[ 0 ] ) );
  // add more here if desired
});


Loudbaby

January 20, 2016 at 2:24 pm

Thanks Josh!
Can you please point me to the name of the file which is the main registration page? I appreciate the help.
– Tommy


Josh

  • Support Staff

January 20, 2016 at 7:43 pm

It turns out that the main registration page doesn’t have a name of a file. You can add a script to a specific WordPress page by using the WordPress plugin API. I recommend using the wp_footer() hook for adding scripts like this one. So you add your code to either a functions plugin or into your WordPress theme’s functions.php file. Then you put the script into a function like in the example below:

The support post ‘order of countries in dropdown selector’ 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