Magento 2 system configuration state multiselect dropdownCustom system configuration fieldsDependent Groups on System ConfigurationCustom Values in Config Dropdownshowing data from db in system config fieldmultiple Region/State in configurationMagento 2 System Configuration for Module issueMagento 2: System Configuration not ReflectingSystem Config Multiselect default all selectedMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMultiselect category dropdown on admin form

Has there been any indication at all that further negotiation between the UK and EU is possible?

Can Ogre clerics use Purify Food and Drink on humanoid characters?

Wifi dongle speed is slower than advertised

Is this one of the engines from the 9/11 aircraft?

Should developer taking test phones home or put in office?

3D Crossword, Cryptic, Statue View & Maze

Set multicolumn to a exact width

Why do textbooks often include the solutions to odd or even numbered problems but not both?

Can we put equal sign after aggregate functions in sql?

Why did pressing the joystick button spit out keypresses?

Long term BTC investing

Is it illegal to withhold someone's passport and green card in California?

Did Karl Marx ever use any example that involved cotton and dollars to illustrate the way capital and surplus value were generated?

Underbar nabla symbol doesn't work

Iterate MapThread with matrices

Find the C-factor of a vote

If I wouldn't want to read the story, is writing it still a good idea?

What is the mechanical difference between the Spectator's Create Food and Water action and the Banshee's Undead Nature Trait?

Computing a trigonometric integral

Tantum religio potuit suadere malorum – Lucretius

How do I set an alias to a terminal line?

Can ADFS connect to other SSO services?

Accidentals and ties

Vanishing of certain coefficients coming from Coxeter groups



Magento 2 system configuration state multiselect dropdown


Custom system configuration fieldsDependent Groups on System ConfigurationCustom Values in Config Dropdownshowing data from db in system config fieldmultiple Region/State in configurationMagento 2 System Configuration for Module issueMagento 2: System Configuration not ReflectingSystem Config Multiselect default all selectedMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMultiselect category dropdown on admin form






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















First i have created country drop-down in back-end system configuration, using source model as



<source_model>MagentoDirectoryModelConfigSourceCountry</source_model>


Next based on country selected, I need to populate states of that country in a multi-select field below country field.



Currently, there is option for loading state a single select drop-down. But I need it as multi-select attribute..



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="new_section">
<group id="general">
<field id="address_country_id" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Applicable Countries</label>
<source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
<frontend_class>countries</frontend_class>
</field>
<field id="address_region_id" translate="label comment" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Applicable Region/State</label>
</field>
</group>
</section>
</system>
</config>


Here is the screenshot



enter image description here










share|improve this question
























  • Can you update your question what you have tried for single select dropdown?

    – Sukumar Gorai
    Jun 14 at 13:40











  • I have updated my question

    – aravind
    Jun 14 at 14:08

















0















First i have created country drop-down in back-end system configuration, using source model as



<source_model>MagentoDirectoryModelConfigSourceCountry</source_model>


Next based on country selected, I need to populate states of that country in a multi-select field below country field.



Currently, there is option for loading state a single select drop-down. But I need it as multi-select attribute..



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="new_section">
<group id="general">
<field id="address_country_id" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Applicable Countries</label>
<source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
<frontend_class>countries</frontend_class>
</field>
<field id="address_region_id" translate="label comment" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Applicable Region/State</label>
</field>
</group>
</section>
</system>
</config>


Here is the screenshot



enter image description here










share|improve this question
























  • Can you update your question what you have tried for single select dropdown?

    – Sukumar Gorai
    Jun 14 at 13:40











  • I have updated my question

    – aravind
    Jun 14 at 14:08













0












0








0








First i have created country drop-down in back-end system configuration, using source model as



<source_model>MagentoDirectoryModelConfigSourceCountry</source_model>


Next based on country selected, I need to populate states of that country in a multi-select field below country field.



Currently, there is option for loading state a single select drop-down. But I need it as multi-select attribute..



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="new_section">
<group id="general">
<field id="address_country_id" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Applicable Countries</label>
<source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
<frontend_class>countries</frontend_class>
</field>
<field id="address_region_id" translate="label comment" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Applicable Region/State</label>
</field>
</group>
</section>
</system>
</config>


Here is the screenshot



enter image description here










share|improve this question
















First i have created country drop-down in back-end system configuration, using source model as



<source_model>MagentoDirectoryModelConfigSourceCountry</source_model>


Next based on country selected, I need to populate states of that country in a multi-select field below country field.



Currently, there is option for loading state a single select drop-down. But I need it as multi-select attribute..



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="new_section">
<group id="general">
<field id="address_country_id" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Applicable Countries</label>
<source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
<frontend_class>countries</frontend_class>
</field>
<field id="address_region_id" translate="label comment" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Applicable Region/State</label>
</field>
</group>
</section>
</system>
</config>


Here is the screenshot



enter image description here







magento-2.2.5 system.xml dynamic state






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 17 at 5:12









Aasim Goriya

3,2371 gold badge11 silver badges43 bronze badges




3,2371 gold badge11 silver badges43 bronze badges










asked Jun 14 at 13:32









aravindaravind

5011 silver badge13 bronze badges




5011 silver badge13 bronze badges












  • Can you update your question what you have tried for single select dropdown?

    – Sukumar Gorai
    Jun 14 at 13:40











  • I have updated my question

    – aravind
    Jun 14 at 14:08

















  • Can you update your question what you have tried for single select dropdown?

    – Sukumar Gorai
    Jun 14 at 13:40











  • I have updated my question

    – aravind
    Jun 14 at 14:08
















Can you update your question what you have tried for single select dropdown?

– Sukumar Gorai
Jun 14 at 13:40





Can you update your question what you have tried for single select dropdown?

– Sukumar Gorai
Jun 14 at 13:40













I have updated my question

– aravind
Jun 14 at 14:08





I have updated my question

– aravind
Jun 14 at 14:08










2 Answers
2






active

oldest

votes


















0














Please try below to get the multiselect dropdown




Ship to Specific Countries
MagentoDirectoryModelConfigSourceCountry
1



Thanks






share|improve this answer






























    0














    1.If you need multi-select field at the system.xml of all country list then add the filed just like below in your group.



     <field id="address_country_id" translate="label comment" type="multiselect" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Applicable Countries</label>
    <source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
    <frontend_class>countries</frontend_class>
    </field>


    2.please flush the Cache.






    share|improve this answer























    • There are two fields country and state. I want the country as select field and based on country selected respected states for that country as multiselect.

      – aravind
      Jun 17 at 4:40













    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f278411%2fmagento-2-system-configuration-state-multiselect-dropdown%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Please try below to get the multiselect dropdown




    Ship to Specific Countries
    MagentoDirectoryModelConfigSourceCountry
    1



    Thanks






    share|improve this answer



























      0














      Please try below to get the multiselect dropdown




      Ship to Specific Countries
      MagentoDirectoryModelConfigSourceCountry
      1



      Thanks






      share|improve this answer

























        0












        0








        0







        Please try below to get the multiselect dropdown




        Ship to Specific Countries
        MagentoDirectoryModelConfigSourceCountry
        1



        Thanks






        share|improve this answer













        Please try below to get the multiselect dropdown




        Ship to Specific Countries
        MagentoDirectoryModelConfigSourceCountry
        1



        Thanks







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 14 at 16:00









        Moin MalekMoin Malek

        4785 silver badges21 bronze badges




        4785 silver badges21 bronze badges























            0














            1.If you need multi-select field at the system.xml of all country list then add the filed just like below in your group.



             <field id="address_country_id" translate="label comment" type="multiselect" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Applicable Countries</label>
            <source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
            <frontend_class>countries</frontend_class>
            </field>


            2.please flush the Cache.






            share|improve this answer























            • There are two fields country and state. I want the country as select field and based on country selected respected states for that country as multiselect.

              – aravind
              Jun 17 at 4:40















            0














            1.If you need multi-select field at the system.xml of all country list then add the filed just like below in your group.



             <field id="address_country_id" translate="label comment" type="multiselect" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Applicable Countries</label>
            <source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
            <frontend_class>countries</frontend_class>
            </field>


            2.please flush the Cache.






            share|improve this answer























            • There are two fields country and state. I want the country as select field and based on country selected respected states for that country as multiselect.

              – aravind
              Jun 17 at 4:40













            0












            0








            0







            1.If you need multi-select field at the system.xml of all country list then add the filed just like below in your group.



             <field id="address_country_id" translate="label comment" type="multiselect" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Applicable Countries</label>
            <source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
            <frontend_class>countries</frontend_class>
            </field>


            2.please flush the Cache.






            share|improve this answer













            1.If you need multi-select field at the system.xml of all country list then add the filed just like below in your group.



             <field id="address_country_id" translate="label comment" type="multiselect" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Applicable Countries</label>
            <source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
            <frontend_class>countries</frontend_class>
            </field>


            2.please flush the Cache.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jun 14 at 17:29









            Rasik MiyaniRasik Miyani

            1329 bronze badges




            1329 bronze badges












            • There are two fields country and state. I want the country as select field and based on country selected respected states for that country as multiselect.

              – aravind
              Jun 17 at 4:40

















            • There are two fields country and state. I want the country as select field and based on country selected respected states for that country as multiselect.

              – aravind
              Jun 17 at 4:40
















            There are two fields country and state. I want the country as select field and based on country selected respected states for that country as multiselect.

            – aravind
            Jun 17 at 4:40





            There are two fields country and state. I want the country as select field and based on country selected respected states for that country as multiselect.

            – aravind
            Jun 17 at 4:40

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f278411%2fmagento-2-system-configuration-state-multiselect-dropdown%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form