How to identify if region_id is required or region (region_name) is required?Received order from a “blocked” countryregion field remains empty in Magento2 customer registrationMagento 2.1.2, Remove “region” from the AddressRemove region from address information in checkoutMagento2 Hide/Show VAT field based on CountryMagento 2.2: How to add country and region drop-downs in a custom step form in one page checkout?Magento 2, address->getRegion() return object instead of stringMagento 2 checkout page how to get country_id from selected shipping addresses?Magento 2 - VAT Number require Validation based on country on Shipping address boxHow to get Region text from address id (Magento 2)

Why did the Herschel Space Telescope need helium coolant?

How can this tool find out registered domains from an IP?

Pre-1972 sci-fi short story or novel: alien(?) tunnel where people try new moves and get destroyed if they're not the correct ones

Should an arbiter claim draw at a K+R vs K+R endgame?

Medieval flying castle propulsion

Why was the Sega Genesis marketed as a 16-bit console?

How Often Do Health Insurance Providers Drop Coverage?

Is the term 'open source' a trademark?

What makes an item an artifact?

What to do when surprise and a high initiative roll conflict with the narrative?

How come the nude protesters were not arrested?

Programming bare microcontroller chips

How can I get an unreasonable manager to approve time off?

How to forge a multi-part weapon?

What makes Ada the language of choice for the ISS's safety-critical systems?

Soft question: Examples where lack of mathematical rigour cause security breaches?

Using "subway" as name for London Underground?

What can I, as a user, do about offensive reviews in App Store?

Is it a problem if <h4>, <h5> and <h6> are smaller than regular text?

Taxi Services at Didcot

Déjà vu, again?

Is a lack of character descriptions a problem?

Where Mongol herds graze

Can U.S. Tax Forms Be Legally HTMLified?



How to identify if region_id is required or region (region_name) is required?


Received order from a “blocked” countryregion field remains empty in Magento2 customer registrationMagento 2.1.2, Remove “region” from the AddressRemove region from address information in checkoutMagento2 Hide/Show VAT field based on CountryMagento 2.2: How to add country and region drop-downs in a custom step form in one page checkout?Magento 2, address->getRegion() return object instead of stringMagento 2 checkout page how to get country_id from selected shipping addresses?Magento 2 - VAT Number require Validation based on country on Shipping address boxHow to get Region text from address id (Magento 2)






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








0















I am creating customer address in Magento 2 programatically.



In few countries the region_id is required, which can be obtained from the model MagentoDirectoryModelRegion, for example forUS country and in few countries the region is required which is a text field, for example for Italy country.



How to identify if region_id is required or region (region_name) is required for the country?










share|improve this question
























  • You can check the country list under Store->Configuration->General->State Required for.

    – Sukumar Gorai
    May 30 at 11:44

















0















I am creating customer address in Magento 2 programatically.



In few countries the region_id is required, which can be obtained from the model MagentoDirectoryModelRegion, for example forUS country and in few countries the region is required which is a text field, for example for Italy country.



How to identify if region_id is required or region (region_name) is required for the country?










share|improve this question
























  • You can check the country list under Store->Configuration->General->State Required for.

    – Sukumar Gorai
    May 30 at 11:44













0












0








0








I am creating customer address in Magento 2 programatically.



In few countries the region_id is required, which can be obtained from the model MagentoDirectoryModelRegion, for example forUS country and in few countries the region is required which is a text field, for example for Italy country.



How to identify if region_id is required or region (region_name) is required for the country?










share|improve this question
















I am creating customer address in Magento 2 programatically.



In few countries the region_id is required, which can be obtained from the model MagentoDirectoryModelRegion, for example forUS country and in few countries the region is required which is a text field, for example for Italy country.



How to identify if region_id is required or region (region_name) is required for the country?







magento2 orders customer-address






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 30 at 11:11









Dhara Bhatti

427112




427112










asked May 30 at 11:01









Milind SinghMilind Singh

778215




778215












  • You can check the country list under Store->Configuration->General->State Required for.

    – Sukumar Gorai
    May 30 at 11:44

















  • You can check the country list under Store->Configuration->General->State Required for.

    – Sukumar Gorai
    May 30 at 11:44
















You can check the country list under Store->Configuration->General->State Required for.

– Sukumar Gorai
May 30 at 11:44





You can check the country list under Store->Configuration->General->State Required for.

– Sukumar Gorai
May 30 at 11:44










1 Answer
1






active

oldest

votes


















0














I have a suggestion for you. Take a look at MagentoDirectoryHelperData



public function getRegionData()

.....
return $regions;



This function will return the list of countries which have the regions are required.



You should build your own logic.






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%2f276722%2fhow-to-identify-if-region-id-is-required-or-region-region-name-is-required%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I have a suggestion for you. Take a look at MagentoDirectoryHelperData



    public function getRegionData()

    .....
    return $regions;



    This function will return the list of countries which have the regions are required.



    You should build your own logic.






    share|improve this answer



























      0














      I have a suggestion for you. Take a look at MagentoDirectoryHelperData



      public function getRegionData()

      .....
      return $regions;



      This function will return the list of countries which have the regions are required.



      You should build your own logic.






      share|improve this answer

























        0












        0








        0







        I have a suggestion for you. Take a look at MagentoDirectoryHelperData



        public function getRegionData()

        .....
        return $regions;



        This function will return the list of countries which have the regions are required.



        You should build your own logic.






        share|improve this answer













        I have a suggestion for you. Take a look at MagentoDirectoryHelperData



        public function getRegionData()

        .....
        return $regions;



        This function will return the list of countries which have the regions are required.



        You should build your own logic.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 30 at 11:44









        Khoa TruongDinhKhoa TruongDinh

        22.5k64491




        22.5k64491



























            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%2f276722%2fhow-to-identify-if-region-id-is-required-or-region-region-name-is-required%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

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

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?