Support

Home Forums Event Espresso Premium States-Provinces

States-Provinces

Posted: August 16, 2018 at 12:44 pm

Viewing 9 reply threads


Fitness Universe

August 16, 2018 at 12:44 pm

This is related to: https://eventespresso.com/topic/stateprovinces/

We’re once again trying to upload states/provinces to countries (not provided by EE) using the PHP files from the State/Province Packs link as a reference. For example, Venezuela:
https://www.paste.org/94701

When we upload the pack, their states don’t append to the country. All the fields are empty. As a note, we’ve commented out “if ($installed) return;” as suggested in the previous thread.


Josh

  • Support Staff

August 16, 2018 at 1:07 pm

Hi John,

May I ask where are you upload the files to? If you go to the WordPress > Plugins screen is there a listing for the state/provinces plugins? and if so did you click the “Activate” link for those items?


Fitness Universe

August 16, 2018 at 1:20 pm

It was uploaded to /wp-content/plugins directory,
clicked on “activate” on the venezuela plugin.
Nothing happens after that.


Fitness Universe

August 16, 2018 at 1:22 pm

*We are on the latest version of EE


Fitness Universe

August 16, 2018 at 1:30 pm

*We are on the latest version of EE


Josh

  • Support Staff

August 16, 2018 at 1:38 pm

If you check the states for the Bahamas listing you’ll probably find the Venezuela states there.

Here’s a corrected version of the code:
https://gist.github.com/joshfeck/276ed5b0234188f95101b60155f4cd6e

You’ll note that the first parameter needs to match the Countrie’s ISO alpha 2 code, which Venezuela’s code is VE. You’ll find a list of the ISO codes here:

https://www.nationsonline.org/oneworld/country_code_list.htm


Fitness Universe

August 16, 2018 at 2:08 pm

Awesome, so it was indeed the ISO codes that were the issue. Once we’ve changed them to their actual ISO code, it worked.

The new issue we have is that because we used ‘BS’ as the country ISO code for the all of the packs we’ve done, all of the states were collected in the Bahamas. Is there a way to remove all of the states?


Josh

  • Support Staff

August 16, 2018 at 2:24 pm

The safe way will be to go into the Event Espresso > General Settings > Countries tab and select Bahamas, and use the UI to delete the states.

If you backup your database first, you could go into phpmyadmin and run this query in the terminal:

Note that in the above example the table prefix is wp_. Your database prefix may be different so you might need to change that to match your database prefix.


Fitness Universe

August 16, 2018 at 2:38 pm

I’m having an issue with appending the Venezuela states to the Venezuela dropdown. I noticed the states continued to get added to the Bahamas dropdown even with the correct ISO code from your correction. Also in the Event Expresso countries tab I get an error when I try to open Bahamas.

function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this}

Im going to delete the values via the database.


Josh

  • Support Staff

August 16, 2018 at 3:05 pm

You might check to see if the incorrect code is loading from elsewhere, like if there’s another plugin active with that same code.

Viewing 9 reply threads

The support post ‘States-Provinces’ 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