Support

Home Forums Event Espresso Premium Country dropdown issue on check out

Country dropdown issue on check out

Posted: September 18, 2018 at 7:46 am

Viewing 6 reply threads


Devaraj

September 18, 2018 at 7:46 am

Hi, we’re having an issue with the country dropdown on the checkbox see screenshot: http://prntscr.com/kvthzl

We’ve tried to resolve this using a script added on header.php and we created another php file named country.php but as we update the plugin, the country dropdown id is now changing. Here’s the script we added on header.php to call the country.php

<?php
cryout_header_hook();
wp_head();
include(get_template_directory().”/country.php”);
$countrlist = code_to_country();

?>

<script type=”text/javascript”>
jQuery(document).ready(function(){
jQuery(‘select[name=”ee_reg_qstn[8014][27]”]’).html(”);
<?php foreach($countrlist as $key => $country){ ?>
jQuery(‘select[name=”ee_reg_qstn[8014][27]”]’).append(“<option value='<?php echo $key; ?>’><?php echo $country; ?></option>”);
<?php } ?>
});
</script>

Is there anything else we can do? Thank you!


Josh

  • Support Staff

September 18, 2018 at 7:51 am

Hi,

May I ask what is the issue you’re trying to solve with the script? Truth be told, the ID will always be unique so you would need to target something with the jQuery (like a class name). That said, the supported way to add more countries would be add them via the UI or add them programmatically via the country packs available from here:

https://github.com/eventespresso/ee-packs-states-provinces#stateprovince-packs-for-event-espresso-4

I think even if you get your script to use a matching selector it will probably break things.


Devaraj

September 19, 2018 at 5:09 am

Hello Josh,

This is what we’re trying to fix http://prntscr.com/kw6j05 there are a lot of unnecessary info inside the country drop down list, how can we get rid of it and add all the states?

Should we use the packs you’re suggesting? Is it free?

Thank you!


Josh

  • Support Staff

September 19, 2018 at 6:24 am

Those are removed by going to Event Espresso > General Settings > Countries then select an errant country, then set Country Appears in Dropdown Select Lists to No. Then repeat for any others.

The packs are free and they’ll save time compared to entering states one by one.


Devaraj

September 19, 2018 at 7:09 am

Hello Josh, thank you for your help!
I’ve downloaded and installed the plugin (UK) http://prntscr.com/kw86l9 and followed the instructions but still cannot get rid of the unnecessary text on the drop down, even on backend it is appearing: http://prntscr.com/kw871w

What plugin should I installed? is it the ee-packs-states-provinces-master or just select one country here: https://eventespresso.com/wiki/install-new-state-province-packs/

This is the country.php file we’re getting info using the script we added before
http://prntscr.com/kw84z0 and this is what we wanted to display on the Country drop down.

The states/provinces appears on the backend http://prntscr.com/kw88qa but how can we remove those unnecessary info inside the dropdown?

Thanks!


Josh

  • Support Staff

September 19, 2018 at 7:19 am

I’ve mentioned this twice already, and I’ll repeat again:

You go to Event Espresso > General Settings > Countries then select an errant country, then set Country Appears in Dropdown Select Lists to No. Then repeat for any others.


Devaraj

September 19, 2018 at 8:22 am

Sorry we got confused, even if we don’t know where it came from the process you gave works. Thank you! You can close the ticket now.

Viewing 6 reply threads

The support post ‘Country dropdown issue on check out’ 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