How to change "State/Province" field from text to dropdown list in checkout page in magento 2

How to change "State/Province" field from text to dropdown list in checkout page in magento 2

August 4, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to change "State/Province" field from text to dropdown list in checkout page in magento 2

Changing State/Province Field from Text to Dropdown List in Magento 2 Checkout

If you’re looking to update your Magento 2 checkout experience by changing the “State/Province” field to display as a dropdown list instead of text, read on for a step-by-step guide to achieve this. We’ll walk through the process assuming you’ve already set up your target country (Australia in this case) and added its states.

Step 1: Configure Magento Settings

Before we dive into the code changes, ensure that your Magento settings are correctly configured:

  1. Navigate to Stores > Configuration > General.
  2. Scroll down to the “State Options” section under the “General” tab.
  3. Set “State is Required for” field to the country you want (e.g., Australia).
  4. Save the configuration.

Step 2: Update Checkout Layout XML

Next, we need to modify the checkout layout XML file to include the state dropdown:

<!-- app/design/frontend/Vendor/Theme/Magento_Checkout/layout/checkout_index_index.xml -->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.root">
            <block class="Magento\Checkout\Block\Checkout\LayoutProcessor" before="-">
                <action method="modifyGetLayout">
                    <argument name="json_config" xsi:type="array">
                        <item name="components" xsi:type="array">
                            <item name="checkout" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="steps" xsi:type="array">
                                        <item name="shipping-step" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="shippingAddress-fieldset" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <item name="region_id" xsi:type="array">
                                                            <item name="customScope" xsi:type="string">checkout</item>
                                                            <item name="sortOrder" xsi:type="number">20</item>
                                                            <item name="type" xsi:type="string">select</item>
                                                            <item name="label" translate="true" xsi:type="string">Region/State</item>
                                                            <item name="visible" xsi:type="boolean">true</item>
                                                            <item name="required" xsi:type="boolean">true</item>
                                                            <item name="validationMessage" translate="true" xsi:type="string">This is a required field.</item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </argument>
                </action>
            </block>
        </referenceBlock>
    </body>
</page>

Copy this layout XML file to your theme at app/design/frontend/Vendor/Theme/Magento_Checkout/layout/checkout_index_index.xml (replace “Vendor” and “Theme” with your actual vendor name).

Step 3: Refresh Magento Cache

After you’ve made these changes:

  1. Navigate to Stores > Configuration.
  2. Click on the “Advanced” tab under “General”.
  3. In the “Developer” section, set “Configuration Scope” to “Default Config”.
  4. Set “Template Settings Configuration” to “Disallow Symlink” and click “Save Config”.
  5. Clear all Magento cache using the bin/magento command:
    php bin/magento cache:flush
    

Step 4: Verify the Changes

Now, open your Magento store’s checkout page in a private or incognito browser window to see the updated state dropdown field:

  1. Click on “Proceed to Checkout”.
  2. In the shipping section, you should now see the “State/Province” field as a dropdown list filled with the states of Australia.

Conclusion

Changing the “State/Province” field from text input to a dropdown list in Magento 2 checkout involves modifying layout XML files and clearing cache. This guide demonstrates how to achieve this for your specific use case with Australia as the target country.

Remember that Magento development often requires careful attention to configuration settings, file locations, and proper cache management. Always test changes thoroughly before deploying them to live environments.

For more advanced customizations and Magento tutorials, check out our blog at Laravel Company.

Magento 2 Checkout Themes Configuration

Our network