setCurrencies( )


Sets the list of currencies that the site will support.

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.

Method Declaration
Copy
function setCurrencies(options: Array<CurrencyCode>): Promise<void>;
Method Parameters
optionsArray<CurrencyCode>Required

Currencies to be supported by the site.

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.

JavaScript
import { currencies } from "wix-pay-backend"; currencies.siteSettings .setCurrencies([{ code: "USD" }, { code: "BRL" }, { code: "JPY" }]) .then(console.log("currencies set"));
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?