Introduction

You can get and set the currencies that you want to support on your site. These are the currencies that are displayed in the currency conversion element and used to convert currencies in your Wix Store.

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

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

Did this help?

getCurrencies( )


Gets the list of supported currencies that you set for your site.

The getCurrencies() function returns a Promise that resolves to an array of currencies that were set for use in the site using siteSetting.setCurrencies(). This function is different from the getAllCurrencies() function in that it gets only the currencies that have been set for use in this site using the siteSetting.setCurrencies() function. The getAllCurrencies() function gets the complete list of all of the currencies that can be supported.

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

Method Declaration
Copy
Request
This method does not take any parameters
Returns
Return Type:Promise<Array<CurrencyCode>>
Get currencies that were set for this site.
JavaScript
Did this help?

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"));
Did this help?