Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve list of all countries in database #11

Closed
amityweb opened this issue Jul 8, 2019 · 2 comments
Closed

Retrieve list of all countries in database #11

amityweb opened this issue Jul 8, 2019 · 2 comments

Comments

@amityweb
Copy link

amityweb commented Jul 8, 2019

How do we fetch a list of all the countries in the database, and their values like country codes?

Two reasons...

  1. For the mapping we need to know what the country codes are to map to our sites.

  2. We actually have a contact form where a user chooses their country. I would like that country automatically chosen. So the country list needs to be all the countries in the database.

So how can we get this list?

Thanks!

@aelvan
Copy link
Contributor

aelvan commented Jul 8, 2019

Hi,

It's not possible to query the Maxmind database for countries, it's strictly for ip lookups.

The isoCode property on Country follows the ISO-3166-1 two-letter standard (https://en.m.wikipedia.org/wiki/ISO_3166-1), so you can get a list of countries that follows that standard from anywhere, and use that.

@aelvan aelvan closed this as completed Jul 8, 2019
@amityweb
Copy link
Author

amityweb commented Jul 8, 2019

So we have to manually add the countries into a field or something? OK.

We are using Commerce on this site, so I have managed to fetch all the Commerce sites which seem to be the same list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants