Skip to content

getLocalesAndCurrenciesSettings():

The getLocalesAndCurrenciesSettings method allows you to retrieve all available locales and currencies in the shop

Returned value

A returned value has a type of object with two properties: - locales - Array of TLocale objects representing all available locales - currencies - Array of TCurrency objects representing all available currencies

Example

In this example we make a StorefrontSettingsApi call to retrieve all available locales and currencies in the shop.

    useStorefront(async (storefront) => {
        const storefrontSettingsApi = storefront.getApiSync('StorefrontSettingsApi');

        const localesAndCurrencies = storefrontSettingsApi.getLocalesAndCurrenciesSettings();

        console.log('Available locales:', localesAndCurrencies.locales);
        console.log('Available currencies:', localesAndCurrencies.currencies);
    });

Storefront Settings API methods reference