I have a question about the source model "Country".

Currently, I can use, in my system.xml file, the following source_model :


In my Stores > Configuration, I can see my dropdown with the list of all countries.

But when I see the code, I can see my select option have only two digits as value, example :

<option value="AF">Afghanistan</option>

But I would like 3 digits, example :

<option value="AFG">Afghanistan</option>

Do you know how can I change that ? Did I need change the source model, or may be it's an option somewhere ?

Thanks !

  • I do not recommend CHANGING hte source model. but rather provide your own – Philipp Sander Mar 7 '19 at 13:39
  • I need 3 digits, I can't change that. So did you know any way ? – Kozame Mar 7 '19 at 13:46
  • provide your onw source model – Philipp Sander Mar 7 '19 at 13:48
  • So 3 digits countries not exist in Magento 2 ? Here I can see the link between 2 and 3 digits so I thought that was possible to switch.. : nextbits.eu/blog/… – Kozame Mar 7 '19 at 14:12
  • they do exist.... but there is not simple "switch" – Philipp Sander Mar 7 '19 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.