i want to use "Curaçao" as a country. It is listed in the "vendor/magento/zendframework1/library/Zend/Locale/Data/en.xml" but i do not see it in the country drop down list.

Does anyone know how i can get it to show up in the list? Thank you.

up vote 0 down vote accepted

You'll also need to add Curaçao to the directory listing in your store. If you have access to the database, you can test using SQL statements, then create a custom module and InstallData script that can be used again in the future.

For more information on the installer script method, you can see how Magento is creating the initial directory items on Github.

Testing with SQL Queries

  1. Add a record to the directory_country table, referencing the territory code from the Zend Locale file.

    INSERT INTO `directory_country` (`country_id`, `iso2_code`, `iso3_code`) VALUES('CW', 'CW', 'CUW');
  2. Create the default region (same as the country, in this case)

    INSERT INTO `directory_country_region` (`country_id`, `code`, `default_name`)VALUES('CW', 'CUW', 'Curaçao');
  3. Finally, add a region name reference.

    INSERT INTO `directory_country_region_name` (`locale`, `region_id`, `name`)
    VALUES('en_US', 
        (SELECT `region_id` FROM `directory_country_region` WHERE `country_id` = 'CW'), 'Curaçao');

Assuming you don't receive any errors, you should be able to clear cache and see Curaçao as an option. Custom Country in Magento 2 Listing

  • Thank you. I did the above steps but i still can not see it. Am i overlooking something? – Darrell Feb 24 '17 at 4:42
  • It's more than a year later, but u totally forgot to accept the answer. thx. – Darrell Aug 4 at 22:31

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.