Magento 2.1.2, Remove “region” from the Address












3















I would like to remove "Region" from all the address forms (checkout, billing address, shipping address, customer's addressbook).
I've set the Backend setting for "Allow to Choose State if It is Optional for Country" to No (under Stores > Configuration > General > General, State Options), but the State Option still gets displayed on the Frontend, but is disabled.



What would be the the right way to remove region option from the address forms?





If I update the Backend settings to:



State is Required for: remove all selected country from here.



Allow to Choose State if It is Optional for Country: Set it as "No"



does not remove the Region (Bundesland/Provinz) on the forms, it only disables it.



enter image description here










share|improve this question





























    3















    I would like to remove "Region" from all the address forms (checkout, billing address, shipping address, customer's addressbook).
    I've set the Backend setting for "Allow to Choose State if It is Optional for Country" to No (under Stores > Configuration > General > General, State Options), but the State Option still gets displayed on the Frontend, but is disabled.



    What would be the the right way to remove region option from the address forms?





    If I update the Backend settings to:



    State is Required for: remove all selected country from here.



    Allow to Choose State if It is Optional for Country: Set it as "No"



    does not remove the Region (Bundesland/Provinz) on the forms, it only disables it.



    enter image description here










    share|improve this question



























      3












      3








      3








      I would like to remove "Region" from all the address forms (checkout, billing address, shipping address, customer's addressbook).
      I've set the Backend setting for "Allow to Choose State if It is Optional for Country" to No (under Stores > Configuration > General > General, State Options), but the State Option still gets displayed on the Frontend, but is disabled.



      What would be the the right way to remove region option from the address forms?





      If I update the Backend settings to:



      State is Required for: remove all selected country from here.



      Allow to Choose State if It is Optional for Country: Set it as "No"



      does not remove the Region (Bundesland/Provinz) on the forms, it only disables it.



      enter image description here










      share|improve this question
















      I would like to remove "Region" from all the address forms (checkout, billing address, shipping address, customer's addressbook).
      I've set the Backend setting for "Allow to Choose State if It is Optional for Country" to No (under Stores > Configuration > General > General, State Options), but the State Option still gets displayed on the Frontend, but is disabled.



      What would be the the right way to remove region option from the address forms?





      If I update the Backend settings to:



      State is Required for: remove all selected country from here.



      Allow to Choose State if It is Optional for Country: Set it as "No"



      does not remove the Region (Bundesland/Provinz) on the forms, it only disables it.



      enter image description here







      magento2 checkout shipping-address address billing-address






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 22 '16 at 10:40







      knospe

















      asked Nov 22 '16 at 9:04









      knospeknospe

      68215




      68215






















          2 Answers
          2






          active

          oldest

          votes


















          5














          If you want disable Region from the address, you have to set below option like.



          State is Required for : remove all selected country from here.



          Allow to Choose State if It is Optional for Country : Set it as "No"



          You can also remove it from "add new address" in customer account.



          Copy file form vendor/magento/module-customer/view/frontend/templates/address/edit.phtml



          add it in your theme. You can remove region from here for customer add new address.



          Save configuration, remove var folder.






          share|improve this answer


























          • If I unset all options for the "State is Required for" and save it, the options do not get saved. @S H Patel can you save "no values" for this attribute?

            – knospe
            Nov 22 '16 at 9:50













          • it required any one country, you can select any one country which is not use for store.

            – Suresh Chikani
            Nov 22 '16 at 9:58











          • This does not remove the region option on the frontend, but it only disables it.

            – knospe
            Nov 22 '16 at 10:02











          • You mean required false ?

            – Suresh Chikani
            Nov 22 '16 at 10:03











          • Following your instructions would make the "region" field not required, but the field would still be displayed on the frontend. My question was how to remove the field, meaning it would not be displayed on the frontend.

            – knospe
            Nov 22 '16 at 10:11





















          0














          You can hide country and region inside your plugins app/code/company/Magento_Theme/Plugin/Checkout/Block/LayoutProcessor.php



          This does not remove it but makes it invisible so close enough from a users point of view for checkout.



          $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
          ['children']['shippingAddress']['children']['shipping-address-fieldset']
          ['children']['country_id']['visible'] = false;


          $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
          ['children']['shippingAddress']['children']['shipping-address-fieldset']['children']
          ['region']['visible'] = false; // I think it's region...


          Or could modify it in the DB possibly, but some of the forms for customer addressbook are still hard coded in template theme. Search in files for the label, make a copy of it as needed in your theme and make it style="display: none;" ?



          Urgh.... why...



          Can also say State is Required for and uncheck the country in the Store COnfig



          https://www.magestore.com/magento-2-tutorial/removedisable-magento-2-state-option/




          To set up the state options in Magento 2 you need to follow these steps:



          On the Admin sidebar, tap Stores. Then under Settings, choose Configuration. In the panel on the left under General, choose General.



          Expand the State Options section, and do the following:



          a, In the State is required for list, select each country where Region/State is > a required entry.



          b, Set the Allow to Choose State if it is Optional for Country field to one of > the following:



          Yes In countries where the state field is not required, includes the State > field as an optional entry.
          No In countries where the state field is not required, omits the State field.
          When complete, tap Save Config .







          share|improve this answer

























            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%2f146897%2fmagento-2-1-2-remove-region-from-the-address%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









            5














            If you want disable Region from the address, you have to set below option like.



            State is Required for : remove all selected country from here.



            Allow to Choose State if It is Optional for Country : Set it as "No"



            You can also remove it from "add new address" in customer account.



            Copy file form vendor/magento/module-customer/view/frontend/templates/address/edit.phtml



            add it in your theme. You can remove region from here for customer add new address.



            Save configuration, remove var folder.






            share|improve this answer


























            • If I unset all options for the "State is Required for" and save it, the options do not get saved. @S H Patel can you save "no values" for this attribute?

              – knospe
              Nov 22 '16 at 9:50













            • it required any one country, you can select any one country which is not use for store.

              – Suresh Chikani
              Nov 22 '16 at 9:58











            • This does not remove the region option on the frontend, but it only disables it.

              – knospe
              Nov 22 '16 at 10:02











            • You mean required false ?

              – Suresh Chikani
              Nov 22 '16 at 10:03











            • Following your instructions would make the "region" field not required, but the field would still be displayed on the frontend. My question was how to remove the field, meaning it would not be displayed on the frontend.

              – knospe
              Nov 22 '16 at 10:11


















            5














            If you want disable Region from the address, you have to set below option like.



            State is Required for : remove all selected country from here.



            Allow to Choose State if It is Optional for Country : Set it as "No"



            You can also remove it from "add new address" in customer account.



            Copy file form vendor/magento/module-customer/view/frontend/templates/address/edit.phtml



            add it in your theme. You can remove region from here for customer add new address.



            Save configuration, remove var folder.






            share|improve this answer


























            • If I unset all options for the "State is Required for" and save it, the options do not get saved. @S H Patel can you save "no values" for this attribute?

              – knospe
              Nov 22 '16 at 9:50













            • it required any one country, you can select any one country which is not use for store.

              – Suresh Chikani
              Nov 22 '16 at 9:58











            • This does not remove the region option on the frontend, but it only disables it.

              – knospe
              Nov 22 '16 at 10:02











            • You mean required false ?

              – Suresh Chikani
              Nov 22 '16 at 10:03











            • Following your instructions would make the "region" field not required, but the field would still be displayed on the frontend. My question was how to remove the field, meaning it would not be displayed on the frontend.

              – knospe
              Nov 22 '16 at 10:11
















            5












            5








            5







            If you want disable Region from the address, you have to set below option like.



            State is Required for : remove all selected country from here.



            Allow to Choose State if It is Optional for Country : Set it as "No"



            You can also remove it from "add new address" in customer account.



            Copy file form vendor/magento/module-customer/view/frontend/templates/address/edit.phtml



            add it in your theme. You can remove region from here for customer add new address.



            Save configuration, remove var folder.






            share|improve this answer















            If you want disable Region from the address, you have to set below option like.



            State is Required for : remove all selected country from here.



            Allow to Choose State if It is Optional for Country : Set it as "No"



            You can also remove it from "add new address" in customer account.



            Copy file form vendor/magento/module-customer/view/frontend/templates/address/edit.phtml



            add it in your theme. You can remove region from here for customer add new address.



            Save configuration, remove var folder.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 22 '16 at 11:39

























            answered Nov 22 '16 at 9:23









            Suresh ChikaniSuresh Chikani

            10.2k53370




            10.2k53370













            • If I unset all options for the "State is Required for" and save it, the options do not get saved. @S H Patel can you save "no values" for this attribute?

              – knospe
              Nov 22 '16 at 9:50













            • it required any one country, you can select any one country which is not use for store.

              – Suresh Chikani
              Nov 22 '16 at 9:58











            • This does not remove the region option on the frontend, but it only disables it.

              – knospe
              Nov 22 '16 at 10:02











            • You mean required false ?

              – Suresh Chikani
              Nov 22 '16 at 10:03











            • Following your instructions would make the "region" field not required, but the field would still be displayed on the frontend. My question was how to remove the field, meaning it would not be displayed on the frontend.

              – knospe
              Nov 22 '16 at 10:11





















            • If I unset all options for the "State is Required for" and save it, the options do not get saved. @S H Patel can you save "no values" for this attribute?

              – knospe
              Nov 22 '16 at 9:50













            • it required any one country, you can select any one country which is not use for store.

              – Suresh Chikani
              Nov 22 '16 at 9:58











            • This does not remove the region option on the frontend, but it only disables it.

              – knospe
              Nov 22 '16 at 10:02











            • You mean required false ?

              – Suresh Chikani
              Nov 22 '16 at 10:03











            • Following your instructions would make the "region" field not required, but the field would still be displayed on the frontend. My question was how to remove the field, meaning it would not be displayed on the frontend.

              – knospe
              Nov 22 '16 at 10:11



















            If I unset all options for the "State is Required for" and save it, the options do not get saved. @S H Patel can you save "no values" for this attribute?

            – knospe
            Nov 22 '16 at 9:50







            If I unset all options for the "State is Required for" and save it, the options do not get saved. @S H Patel can you save "no values" for this attribute?

            – knospe
            Nov 22 '16 at 9:50















            it required any one country, you can select any one country which is not use for store.

            – Suresh Chikani
            Nov 22 '16 at 9:58





            it required any one country, you can select any one country which is not use for store.

            – Suresh Chikani
            Nov 22 '16 at 9:58













            This does not remove the region option on the frontend, but it only disables it.

            – knospe
            Nov 22 '16 at 10:02





            This does not remove the region option on the frontend, but it only disables it.

            – knospe
            Nov 22 '16 at 10:02













            You mean required false ?

            – Suresh Chikani
            Nov 22 '16 at 10:03





            You mean required false ?

            – Suresh Chikani
            Nov 22 '16 at 10:03













            Following your instructions would make the "region" field not required, but the field would still be displayed on the frontend. My question was how to remove the field, meaning it would not be displayed on the frontend.

            – knospe
            Nov 22 '16 at 10:11







            Following your instructions would make the "region" field not required, but the field would still be displayed on the frontend. My question was how to remove the field, meaning it would not be displayed on the frontend.

            – knospe
            Nov 22 '16 at 10:11















            0














            You can hide country and region inside your plugins app/code/company/Magento_Theme/Plugin/Checkout/Block/LayoutProcessor.php



            This does not remove it but makes it invisible so close enough from a users point of view for checkout.



            $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
            ['children']['shippingAddress']['children']['shipping-address-fieldset']
            ['children']['country_id']['visible'] = false;


            $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
            ['children']['shippingAddress']['children']['shipping-address-fieldset']['children']
            ['region']['visible'] = false; // I think it's region...


            Or could modify it in the DB possibly, but some of the forms for customer addressbook are still hard coded in template theme. Search in files for the label, make a copy of it as needed in your theme and make it style="display: none;" ?



            Urgh.... why...



            Can also say State is Required for and uncheck the country in the Store COnfig



            https://www.magestore.com/magento-2-tutorial/removedisable-magento-2-state-option/




            To set up the state options in Magento 2 you need to follow these steps:



            On the Admin sidebar, tap Stores. Then under Settings, choose Configuration. In the panel on the left under General, choose General.



            Expand the State Options section, and do the following:



            a, In the State is required for list, select each country where Region/State is > a required entry.



            b, Set the Allow to Choose State if it is Optional for Country field to one of > the following:



            Yes In countries where the state field is not required, includes the State > field as an optional entry.
            No In countries where the state field is not required, omits the State field.
            When complete, tap Save Config .







            share|improve this answer






























              0














              You can hide country and region inside your plugins app/code/company/Magento_Theme/Plugin/Checkout/Block/LayoutProcessor.php



              This does not remove it but makes it invisible so close enough from a users point of view for checkout.



              $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
              ['children']['shippingAddress']['children']['shipping-address-fieldset']
              ['children']['country_id']['visible'] = false;


              $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
              ['children']['shippingAddress']['children']['shipping-address-fieldset']['children']
              ['region']['visible'] = false; // I think it's region...


              Or could modify it in the DB possibly, but some of the forms for customer addressbook are still hard coded in template theme. Search in files for the label, make a copy of it as needed in your theme and make it style="display: none;" ?



              Urgh.... why...



              Can also say State is Required for and uncheck the country in the Store COnfig



              https://www.magestore.com/magento-2-tutorial/removedisable-magento-2-state-option/




              To set up the state options in Magento 2 you need to follow these steps:



              On the Admin sidebar, tap Stores. Then under Settings, choose Configuration. In the panel on the left under General, choose General.



              Expand the State Options section, and do the following:



              a, In the State is required for list, select each country where Region/State is > a required entry.



              b, Set the Allow to Choose State if it is Optional for Country field to one of > the following:



              Yes In countries where the state field is not required, includes the State > field as an optional entry.
              No In countries where the state field is not required, omits the State field.
              When complete, tap Save Config .







              share|improve this answer




























                0












                0








                0







                You can hide country and region inside your plugins app/code/company/Magento_Theme/Plugin/Checkout/Block/LayoutProcessor.php



                This does not remove it but makes it invisible so close enough from a users point of view for checkout.



                $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
                ['children']['shippingAddress']['children']['shipping-address-fieldset']
                ['children']['country_id']['visible'] = false;


                $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
                ['children']['shippingAddress']['children']['shipping-address-fieldset']['children']
                ['region']['visible'] = false; // I think it's region...


                Or could modify it in the DB possibly, but some of the forms for customer addressbook are still hard coded in template theme. Search in files for the label, make a copy of it as needed in your theme and make it style="display: none;" ?



                Urgh.... why...



                Can also say State is Required for and uncheck the country in the Store COnfig



                https://www.magestore.com/magento-2-tutorial/removedisable-magento-2-state-option/




                To set up the state options in Magento 2 you need to follow these steps:



                On the Admin sidebar, tap Stores. Then under Settings, choose Configuration. In the panel on the left under General, choose General.



                Expand the State Options section, and do the following:



                a, In the State is required for list, select each country where Region/State is > a required entry.



                b, Set the Allow to Choose State if it is Optional for Country field to one of > the following:



                Yes In countries where the state field is not required, includes the State > field as an optional entry.
                No In countries where the state field is not required, omits the State field.
                When complete, tap Save Config .







                share|improve this answer















                You can hide country and region inside your plugins app/code/company/Magento_Theme/Plugin/Checkout/Block/LayoutProcessor.php



                This does not remove it but makes it invisible so close enough from a users point of view for checkout.



                $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
                ['children']['shippingAddress']['children']['shipping-address-fieldset']
                ['children']['country_id']['visible'] = false;


                $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']
                ['children']['shippingAddress']['children']['shipping-address-fieldset']['children']
                ['region']['visible'] = false; // I think it's region...


                Or could modify it in the DB possibly, but some of the forms for customer addressbook are still hard coded in template theme. Search in files for the label, make a copy of it as needed in your theme and make it style="display: none;" ?



                Urgh.... why...



                Can also say State is Required for and uncheck the country in the Store COnfig



                https://www.magestore.com/magento-2-tutorial/removedisable-magento-2-state-option/




                To set up the state options in Magento 2 you need to follow these steps:



                On the Admin sidebar, tap Stores. Then under Settings, choose Configuration. In the panel on the left under General, choose General.



                Expand the State Options section, and do the following:



                a, In the State is required for list, select each country where Region/State is > a required entry.



                b, Set the Allow to Choose State if it is Optional for Country field to one of > the following:



                Yes In countries where the state field is not required, includes the State > field as an optional entry.
                No In countries where the state field is not required, omits the State field.
                When complete, tap Save Config .








                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 13 mins ago

























                answered 20 mins ago









                Liam MitchellLiam Mitchell

                1136




                1136






























                    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%2f146897%2fmagento-2-1-2-remove-region-from-the-address%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

                    Magento 2 controller redirect on button click in phtml file

                    Polycentropodidae