0

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.

1

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

| improve this answer | |
  • 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 '18 at 22:31
0

In magento 2.3.4 curacauo is already available.

If you are in older versions, you can use @Michael Martin his answer.

In the update to Magento 2.3.4 you will occur no errors, so with future improvements in mind to 2.3.4 this is a fast solution to use for Below Magento 2.3.4

I tested it on magento 2.3.3 then updated to 2.3.4 and no errors.

| improve this answer | |

Your Answer

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

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