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.

Order

GetCurrentOrder

Gets the customers current order.

Arguments

Name Type Default Description
storeId long _storeId Id of the store.
autoCreate boolean true Indicate if a new order should be created if the customer doesn't have one.
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
order An order object - without server secure information.

Example

var order = TC.getCurrentOrder({storeId:1});

SetCurrentOrder

Sets the customers current order.

Arguments

Name Type Description
storeId long Id of the store.
orderId Guid Unique id of the order.

Return values

Type Description
Order The new current order object.

Example

@using TeaCommerce.Umbraco.Web
@using TeaCommerce.Api.Models
@{
  Order order = TC.SetCurrentOrder( 1, new Guid("276F2B9C-C50E-4F60-8431-C4368B3EFE14") );
}

RemoveCurrentOrder

Removes the customers current order from session. The order will not be deleted.

Arguments

Name Type Description
storeId long Id of the store.

Example

<form method="post" action="/base/TC/FormPost.aspx">
  <input name="RemoveCurrentOrder" value="" type="hidden" />
  <input name="storeId" value="1" type="hidden" />
  <input value="Remove order" type="submit" />
</form>

GetCurrentFinalizedOrder

Gets the customers current finalized order.

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
order An order object - without server secure information.

Example

var order = TC.getCurrentFinalizedOrder({storeId:1});

GetOrder

Gets a specific order.

Arguments

Name Type Default Description
orderId Guid The unique identifier of the order.
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
order An order object - without server secure information.

Example

var order = TC.getOrder({storeId:1, orderId:'dc354705-c1de-413e-a9d2-756294cfa2ec'});

GetOrders

Gets a collection of orders.

Arguments

Name Type Default Description
orderIds Guid[] List of unique id's of the orders.
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
order[] An order object - without server secure information.

Example

var orders = TC.getOrders({storeId:1, orderIds:['dc354705-c1de-413e-a9d2-756294cfa2ec', '066B0680-E955-4A63-BE24-7D1E7A1F08AE']});

GetFinalizedOrdersForCustomer

Gets all finalized orders for a specific customer.

Arguments

Name Type Default Description
customerId string The id of the customer.
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
order[] An order object - without server secure information.

Example

var orders = TC.getFinalizedOrdersForCustomer({storeId:1, customerId:'10245'});
Last Updated: 9/2/2019, 10:22:34 AM