Data
Magento\Directory\Helper\Data
What it does
This helper class provides utility methods for working with geographic and currency data in Magento 2.
Developers use it to retrieve country and region collections, check if postal codes or regions are required for specific countries, convert currencies, get default country settings, and access weight units.
It's commonly used in checkout, address forms, and anywhere geographic or currency information is needed.
Public Methods
- getRegionCollection()
- getCountryCollection()
- getRegionJson()
- currencyConvert()
- getCountriesWithOptionalZip()
- isZipCodeOptional()
- getCountriesWithStatesRequired()
- isShowNonRequiredState()
- isRegionRequired()
- getBaseCurrencyCode()
- getDefaultCountry()
- getRegionData()
- getTopCountryCodes()
- getWeightUnit()
- _resetState()