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.

Country Region

GetCountryRegion

Gets a country region from a specfic store.

Arguments

Name Type Default Description
countryRegionId long Id of the country region
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
countryRegion A country region object.

Example

var countryRegion = TC.getCountryRegion({storeId:1, countryRegionId:2});

GetCountryRegions

Gets the country regions for a specific store. Specify the countryId parameter to only get country regions for this country.

Arguments

Name Type Default Description
countryId long? Id of the country.
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
countryRegion[] A collection of country region objects.

Example

var countryRegions = TC.getCountryRegions({storeId:1});

GetCurrentPaymentCountryRegion

Gets the current payment country region of the customer's session. If the customer has a current order the payment country region 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
countryRegion A country region object.

Example

var countryRegion = TC.getCurrentPaymentCountryRegion({storeId:1});

GetCurrentShippingCountryRegion

Gets the current shipping country region of the customer's session. If the customer has a current order the shipping country region 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
countryRegion A country region object.

Example

var countryRegion = TC.getCurrentShippingCountryRegion({storeId:1});

SetCurrentPaymentCountryRegion

Changes the current payment country region of the customer's session. The payment country region is also changed for the customer's current order if present. If the country region is changed and the current payment and method isn't allowed in this country region - then the payment method will change to the default payment method of the new payment country region. If no current payment country region is specified it will fallback to use the payment country.

Arguments

Name Type Description
storeId long Id of the store.
countryRegionId long? Id of the country region to change to.

Example

<form method="post" action="/base/TC/FormPost.aspx">
  <input name="SetCurrentPaymentCountryRegion" value="countryRegionId" type="hidden" />
  <input name="storeId" value="1" type="hidden" />
  <input name="countryRegionId" value="3" type="hidden" />
  <input value="Change payment country region" type="submit" />
</form>

SetCurrentShippingCountryRegion

Changes the current shipping country region of the customer's session. The shipping country region is also changed for the customer's current order if present. If the country region is changed and the current shipping method isn't allowed in this country region - then the shipping method will change to the default shipping method of the new shipping country region. If no current shipping country region is specified it will fallback to use the shipping country and then payment country.

Arguments

Name Type Description
storeId long Id of the store.
countryRegionId long? Id of the country region to change to.

Example

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