2

I want to add only Nigeria as the option in Country Dropdown, and the nigerian states in the states/province dropdown. How to do that. I tried something through Admin panel, when i found these issues when i select US and nigeria and shown in the below screenshot. https://prnt.sc/oicwpt https://prnt.sc/oicyiz

How to avoid this? I want only nigerian states to be in the dropdown.

1 Answer 1

3

Basically Magento takes the list of regions/states from its own database. If you look into Magento database you would find two tables named directory_country_region and directory_country_region_name. directory_country_region is for adding states/regions and directory_country_region_name is for locale translations. By default Magento has regions only for few countries. If selected country has any region record in table then it appears as dropdown, else region area appears as input text.

So if you want to show states dropdown for Nigeria you need to enter records into these tables through script/query. Put country_id as NG. Please refer https://mage2-blog.com/magento-add-regions-to-country/ to know more about inserting states through query.

Hope it helps you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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