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.
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.
Gets a currency from a specfic store.
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. |
Type | Description |
---|---|
currency | A currency object. |
var currency = TC.getCurrency({storeId:1, currencyId:2});
Gets the currencies for a specific store that are allowed in the current payment country region. Will fallback to current payment country.
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. |
Type | Description |
---|---|
currency[] | A collection of currency objects. |
var currencies = TC.getCurrencies({storeId:1});
Gets the current currency of the customer's session. If the customer has a current order the currency of that order is returned.
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. |
Type | Description |
---|---|
currency | A currency object. |
var currency = TC.getCurrency({storeId:1});
Changes the current currency of the customer's session. The currency is also changed for the customer's current order if present.
Name | Type | Description |
---|---|---|
storeId | long | Id of the store. |
currencyId | long | Id of the currency to change to. |
<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>