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 Property

AddOrUpdateOrderProperty

Adds or updates a single custom order property on the current order. If the customer does not have a current order a new one will be created.

Arguments

Name Type Description
storeId long Id of the store.
key string The key/alias of the property.
value string Value of the property.

Return values

Type Description
CustomProperty The custom order property just created or updated.

Example

@using TeaCommerce.Umbraco.Web
@using TeaCommerce.Api.Models
@{
  CustomProperty customProperty = TC.AddOrUpdateOrderProperty(1, "company", "Tea Commerce");
}

AddOrUpdateOrderProperties

Adds or updates a collection of custom order properties on the current order. If the customer does not have a current order a new one will be created.

Arguments

Name Type Description
storeId long Id of the store.
properties A list of key/value pairs identifying the property alias and name of a html input to deliver the value.

Example

<form method="post" action="/base/TC/FormPost.aspx">
  <input name="AddOrUpdateOrderProperties" value="properties" type="hidden" />
  <input name="storeId" value="1" type="hidden" />
  <input name="properties" value="firstName, lastName, email" type="hidden" />
  <input name="firstName" type="text" placeholder="First name" />
  <input name="lastName" type="text" placeholder="Last name" />
  <input name="email" type="text" placeholder="Email" />
  <input value="Update order properties" type="submit" />
</form>

System Properties

When updating an order, as well as the properties passed via the AddOrUpdateOrderProperty or AddOrUpdateOrderProperties methods properties collection as documented above, Tea Commerce will also add some system defined properties to the Order who's values will be automatically extracted. Details of these properties and how they are extracted can be found below.

Name Source Description
CustomerId Current logged in Members member ID. Extracted at the time of GeneratePaymentForm() being called. The ID of the customer making the order. Useful if you have a members only store and you want to find all orders belonging to the same customer.
PaymentInformation.FirstName Extracted from an Orders properties collection. Property alias must be "firstName". The first name of the person making the order.
PaymentInformation.LastName Extracted from an Orders properties collection. Property alias must be "lastName". The last name of the person making the order.
PaymentInformation.Email Extracted from an Orders properties collection. Property alias must be "email". The email address of the person making the order.
Last Updated: 2/6/2019, 8:40:54 AM