Skip to main content

Magento 2, How regionUpdater is working?

I'm trying to figure out how regionUpdater works in Magento 2. Region Updater is when you select a country, Magento reloads the region field depending on which country was selected.

I went to Magento's Checkout module then saw regionUpdater Javascript file in this path:

\vendor\magento\module-checkout\view\frontend\web\js\region-updater.js

I went to my browser and tried to put some breakpoints to it but I cannot see regionUpdater.js is included. I tried many ways to figure out how it is working but cannot understand it.

My purpose is I'm going to implement a **cityUpdater function that help Magento reload the city field based on the region field - the same way as regionUpdater.

HungDQ
  • 812
  • 10
  • 31