Previous Docs Version

The documentation you are viewing is for a previous version of Tea Commerce. Click here to jump to the current stable version.

Currency

GetCurrency

Gets a currency from a specfic store.

Arguments

Name Type Default Description
currencyId long The currency id.
storeId long _storeId Id of the store.
async boolean false Specifies if a request should be asynchronously.
successfn function(json[, jQForm]) A function to be called if the request succeeds.
errorfn function(json) A function to be called if the request fails.

Return values

Type Description
currency A currency object.

Example

var currency = TC.getCurrency({storeId:1, currencyId:2});

GetCurrencies

Gets the currencies for a specific store that are allowed in the current payment country region. Will fallback to current payment country.

Arguments

Name Type Default Description
storeId long _storeId Id of the store.
onlyAllowed boolean true Specify if only currencies allowed in the current session state will be returned.
async boolean false Specifies if a request should be asynchronously.
successfn function(json[, jQForm]) A function to be called if the request succeeds.
errorfn function(json) A function to be called if the request fails.

Return values

Type Description
currency[] A collection of currency objects.

Example

var currencies = TC.getCurrencies({storeId:1});

GetCurrentCurrency

Gets the current currency of the customer's session. If the customer has a current order the currency of that order is returned.

Arguments

Name Type Default Description
storeId long _storeId Id of the store.
async boolean false Specifies if a request should be asynchronously.
successfn function(json[, jQForm]) A function to be called if the request succeeds.
errorfn function(json) A function to be called if the request fails.

Return values

Type Description
currency A currency object.

Example

var currency = TC.getCurrency({storeId:1});

SetCurrentCurrency

Changes the current currency of the customer's session. The currency is also changed for the customer's current order if present.

Arguments

Name Type Description
storeId long Id of the store.
currencyId long Id of the currency to change to.

Example

<form method="post" action="/base/TC/FormPost.aspx">
  <input name="SetCurrentCurrency" value="currencyId" type="hidden" />
  <input name="storeId" value="1" type="hidden" />
  <input name="currencyId" value="3" type="hidden" />
  <input value="Change currency" type="submit" />
</form>
Last Updated: 12/27/2018, 4:46:55 PM