Search.../

setCurrencies( )

Sets the list of currencies that the site will support.

Description

The setCurrencies() function sets the list of currencies that you want your site to support. This is a subset of the list of currencies supported by Wix as returned by getAllCurrencies(). The currencies set will be displayed in the currency conversion dropdown element. Selecting a currency from the dropdown on a store page will display the prices in the selected currency.

Syntax

function setCurrencies(options: Array<CurrencyCode>): Promise<void>

setCurrencies Parameters

NAME
TYPE
DESCRIPTION
options
Array<CurrencyCode>

Currencies to be supported by the site.

Returns

Return Type:

Promise<void>

Was this helpful?

Set the currencies to be supported by this site.

Note: For SiteSettings functions to work, your site must contain a Wix Stores page including the currency conversion element.

The currency codes used must exist in the array returned by the getAllCurrencies() function.

Copy Code
1import {currencies} from 'wix-pay-backend';
2
3currencies.siteSettings.setCurrencies(
4 [
5 {"code": "USD"},
6 {"code": "BRL"},
7 {"code": "JPY"}
8 ]
9)
10 .then(console.log("currencies set")
11 );