Developer forum

Forum » CMS - Standard features » Country field for user

Country field for user

Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

When creating a user there is a dropdown-field for "Billing / Shipping country". 

Beofre there were a textfield "Country".

I have been using the "Users" for displaying retailers in a solution. I have indexed them with a UserIndexBuilder and displayed them in frontend with a QueryPublisher. 

The probem is that with the new dropdown field I only get the Country Code to the front end.

Is there a standard way of beeing able to display the Country Name in front end that I am missing or do I need to do something custom for this?

Regards / Aki

 

 

CountryField.png

Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Yes, we have switched to country code in order to avoid 400 ways of spelling Denmark and make shipping, payment and other mappings work better.

You can use RegionInfo from .NET - create an instance from the two letter country code and the use the EnglishName or DisplayName property.

Votes for this answer: 1
 
Aki Ruuskanen
Aki Ruuskanen
Reply

Yes, I understand. That is a good improvment. 

And of course RegionInfo. :) 

/Aki

 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi Nicolai, 

What is the source for the new country code field? 

I am missing "Angola" from the dropdown. smiley

/Aki

country-field.png
 
Dynamicweb Employee
Carsten Boll
Reply

That's strange, because Angola is definitely present on my solutions...

Angola.png
 
Aki Ruuskanen
Aki Ruuskanen
Reply

Yes in deed. 

I thought that the source would be the table EcomGlobalISO but there is a lot of countries there that I don't have in my dropdown. 

/Aki

no-angola.png
 
Nicolai Pedersen
Reply
This post has been marked as an answer

The source is .net: 

Globalization.CultureInfo.GetCultures(CultureTypes.AllCultures And Not CultureTypes.NeutralCultures)

So I guess Angola is not a country in .net... Or it has to be installed or something.

You can add it yourself. See this: https://stackoverflow.com/questions/23087948/c-sharp-culture-name-for-angola

Votes for this answer: 1
 
Aki Ruuskanen
Aki Ruuskanen
Reply

Poor Angolans... sad

Alright, thanks Nicolai. yes 

 

 

You must be logged in to post in the forum