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.

Shipping Method

GetShippingMethod

Gets a shipping method from a specfic store.

Arguments

Name Type Default Description
shippingMethodId long Id of the shipping method.
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
shippingMethod A shipping method object.

Example

var shippingMethod = TC.getshippingMethod({storeId:1, shippingMethodId:2});

GetShippingMethods

Gets a collection of all shipping methods that are allowed in the current shipping country and shipping country region - fallback to the payment country and country region.

Arguments

Name Type Default Description
storeId long _storeId Id of the store.
onlyAllowed boolean true Specify if only payment methods 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
shippingMethod[] A collection of shipping method objects.

Example

var shippingMethods = TC.getShippingMethods({storeId:1});

GetCurrentShippingMethod

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

Example

var shippingMethod = TC.getCurrentShippingMethod({storeId:1});

SetCurrentShippingMethod

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

Arguments

Name Type Description
storeId long Id of the store.
shippingMethodId long? Id of the shipping method to change to.

Example

<form method="post" action="/base/TC/FormPost.aspx">
  <input name="SetCurrentShippingMethod" value="shippingMethodId" type="hidden" />
  <input name="storeId" value="1" type="hidden" />
  <input name="shippingMethodId" value="3" type="hidden" />
  <input value="Change shipping method" type="submit" />
</form>

GetPriceForShippingMethod

Get the price for a specific shipping method, based on the customers current currency, shipping country and shipping country region - fallback to the payment country and country region.

Arguments

Name Type Default Description
shippingMethodId long Id of the shipping method.
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
price A price object.

Example

var price = TC.getPriceForShippingMethod({storeId:1, shippingMethodId:2});
Last Updated: 9/2/2019, 10:22:34 AM