Support

Home Forums Event Espresso Premium Changing Order of Countries and States

Changing Order of Countries and States

Posted: November 22, 2018 at 1:58 am

Viewing 1 reply thread


Mike Doughty

November 22, 2018 at 1:58 am

Hi,

We are using EE4, and Infusionsoft EE Integration. When they pay and have to select state and country, our County is at the very bottom. Is it possible to change the order of the countries, so we can have our country at the top?

Thanks, Mike


Tony

  • Support Staff

November 22, 2018 at 4:34 am

Hi Mike,

Yes, you can using a function like this:

https://gist.github.com/Pebblo/aeae0b4fb66ee59e3bb8c41c3d1904eb

You add that to a custom functions plugin on your site, iirc you already have one but just in case, here’s a link to the documentation to create one:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

Set the order of the countries you want at the top of the list here:

https://gist.github.com/Pebblo/aeae0b4fb66ee59e3bb8c41c3d1904eb#file-example-php-L7-L12

By default my function uses ” (blank default), ‘United Kingdom’, ‘Canada’, ‘United States’ then all of the other countries but you can set which order your prefer. You’ll need to use country ISO code to set the order, you can find that for each country in:

Event Espresso -> General Settings -> Countries.

Select the country and wait for the settings to load, you’ll see the ‘Country ISO Code’ field there.

Viewing 1 reply thread

The support post ‘Changing Order of Countries and States’ 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