I want to display list of country in my system.xml

<field id="country" translate="label" type="text" showInDefault="1" showInWebsite="1" showInStore="1">

How we do this?


2 Answers 2


Use class Magento\Directory\Model\Config\Source\Country for country list

<field id="specificcountry" translate="label" type="multiselect" sortOrder="16" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Ship to Specific Countries</label>
<field id="country" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Select Country</label>

Your Answer

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

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