getCurrencies(): TCurrency[]¶
The getCurrencies method allows you to retrieve all available currencies in the shop
Returned value¶
A returned value has a type of array of TCurrency objects representing all available currencies in the shop.
Example¶
In this example we make a StorefrontSettingsApi call to retrieve all available currencies in the shop.
useStorefront(async (storefront) => {
const storefrontSettingsApi = storefront.getApiSync('StorefrontSettingsApi');
const currencies = storefrontSettingsApi.getCurrencies();
currencies.forEach((currency) => {
console.log('Currency:', currency.name, 'Code:', currency.code, 'Symbol:', currency.symbol);
});
});
Storefront Settings API methods reference¶
- getSkinSettings
- getPageSettings
- selectSkinSettings$
- selectPageSettings$
- selectFrontstoreApiUrl$
- getLocales
- selectLocales$
- getLocalesAndCurrenciesSettings
- selectLocalesAndCurrenciesSettings$
- getAllLocales
- selectAllLocales$
- selectCurrencies$
- getCountries
- selectCountries$
- getCountryById
- selectCountryById$
- getCountryByCode
- selectCountryByCode$