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

            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