Country

Our on–line businesses tend to be inherently global. This means that we get to interact with people coming from different countries and cultures. What is innocuous or even expected in one culture may be very offensive in another. Knowing which country the person you're talking to comes from can help avoid this kind of misunderstandings.

Akeeba Ticket System can display a small flag with the user's country (and a tooltip with the full name of the country) next to the user's username when displaying their posts in a ticket thread. To do so it needs a user profile custom field which contains the country's ISO 3166 two letter code e.g. DE for Germany, GR for Greece and so on.

While you could use the built–in List field type, meticulously entering the ISO country codes and country names, we do not think this is a particularly practical approach. Instead, we recommend using the Country custom field included in Tassos Marinos' Advanced Custom Fields. The free of charge version will do. The two main reasons for the recommendation is that you do not need to enter 200+ country codes and names by hand and that it also does IP geolocation to pre–fill the field with the best guess of the user's country (the latter only in the paid version).

Now we'll create the user profile field. From the side menu of your site go to Users, Fields. Click on the New button in the toolbar. Use the following settings:

  • Tile: Country

  • Type: ACF - Country

  • Name: country

  • Label: Your country

  • Description: Tell us which country you live in. This gives us cultural context which will make it easier to provide support for you.

  • Required: No

  • Only Use In Subform: No

  • Return Value: Country Code

  • Multiple Country Selection: No

As–is, the custom field cannot be edited by the user which makes it rather useless! Click on the Permissions tab. Click on the Registered group. Set Edit Custom Field Value to Allowed. Click on the Manager group and do the same.

Finally click on Save & Close.

When a user edits their profile in the frontend they will now be able to select their country.

Now we need to tell Akeeba Ticket System to use this field.

From your site backend's side menu click on Components, Akeeba Ticket System, Control Panel. Click on Options. Click on the Common tab. From the Country Field dropdown choose Country (country). This is the field we created above.

Whenever Akeeba Ticket System displays a user's post it will show a flag with the user's country next to the username. If the user has not selected a country you will of course not see a flag at all.