Cart

Extends Object. A "cart" variable containing the session's Cart object is automatically instantiated on all pages. The Cart object is also the foundation of Orders and Enquiries.


Properties
channelCurrency

Type String

The ISO code of currency of the channel at the point of instantiation e.g. GBP or USD.

continueShoppingUrl

Type Url

The URL of the last product or category page before landing on the cart page.

created

Type Date

The date the cart, order or enquiry was created on. For orders the created date represents the date the cart it was converted from was created.

currency

Type String

The currency ISO code for the Cart object.

customerReference

Type String

A purchase order reference given by the customer. Only set on Orders.

discount

Type Money

The total discount applied to the cart, either net or gross depending on the taxRule.

hasCutOff

Type Boolean

Returns true if the cart's postage option has a cut off time less than the current time. This allows us to show the postage's cut-off message to the visitor.

hasDiscount

Type Boolean

Returns true if the cart has any discounts applied.

id

Type Number

The system ID for the cart.

includesTax

Type Boolean

Returns true if the cart's taxRule is set to includingTax, else false.

isCart

Type Boolean

True if the type of the object is cart.

isCustomShipping

Type Boolean

True if an administrator has applied custom shipping costs to a cart or order.

isEnquiry

Type Boolean

True if the cart type is set to enquiry.

isOrder

Type Boolean

True if the cart type is set to order.

isQuote

Type Boolean

Not yet implemented.

isTaxExempt

Type Boolean

True if the cart has a valid taxNumber.

ordered

Type Date

The date an order was placed. This is applicable to orders only and contains a null value for carts.

postageMethod

Type String

Returns the String name of the postage method.

quickfind

Type Number

The Account's sequential reference number. Quickfind is set once the Cart is converted to an Order or Enquiry. It is not set for shopping Carts.

recurringDiscount

Type Money

Not yet implemented.

recurringShipping

Type Money

Not yet implemented.

recurringSubtotal

Type Money

Not yet implemented.

recurringTax

Type Money

Not yet implemented.

recurringTotal

Type Money

Not yet implemented.

reference

Type String

The Account's sequential reference including prefix, quickfind and suffix. The reference is set once the Cart is converted to an Order or Enquiry. It is not set for shopping Carts.

shipping

Type Money

The total cost of shipping either net or gross depending on the taxRule.

source

Type String

The original source of where the cart, enquiry or order was instantiated. This property is important in segmenting order activity by:

  • website
  • telesales
status

Type String

The status of the Cart object is relevant only to orders and enquiries.

subtotal

Type Money

The subtotal of all lines in the cart excluding shipping and before discount. The subtotal will be either net or gross depending on the taxRule.

tax

Type Money

The total tax levied on the cart.

taxNumber

Type String

Goods shipped within the EC, but outside the European merchant's own country may allow their customer to provide a valid VAT number. The tax registration number is stored with the order.

taxNumberVerified

Type Boolean

True if the VAT number provided by the customer was verified.
False if not.

taxRule

Type String

The tax rule for the cart may be:

  • includingTax
  • excludingTax

European based consumer sites generally have a taxRule of includingTax, whilst trade or US websites prefer excludingTax rules.

Note: the taxRule is independent of whether the merchant charges tax on sales. So a merchant in the United Kingdom who is not yet VAT registered may still have a tax rule of includingTax, despite no levy.

total

Type Money

The gross total for the cart.

type

Type String

The type of cart:

  • cart
  • enquiry
  • order
weight

Type Number

The gross shipping weight of the cart in kg.



Methods
allowCoupons()

Returns Boolean

Returns true if promotional discount coupons are available to be added to the Cart.

availablePostage()

Returns Array

Returns an Array of available Postage options.

billingAddress()

Returns Address

Returns the billing address for the customer.

convertedFrom()

Returns Cart or Null

Returns the originating object the Cart object was converted from, or Null.

coupon()

Returns Discount

Returns a Discount object if the cart contains a discount coupon, else Null.

creditcard()

Returns Object

Returns an Object containing the card for the order:

  • holder - the name of the card holder
  • last4Digits - the last 4 digits of the PAN
  • type - the type of card used
  • expires - the card's expiry date

If the paymentMethod for the Cart object is not card a null value is returned.

Note: we do not hold full card data anywhere in our platform.

customer()

Returns Contact

Returns a Contact object containing the customer details for the Cart object.

hasAvailablePostage()

Returns Boolean

Returns true if the Cart has available postage options.

hasCoupon()

Returns Boolean

Returns true if the Cart contains a discount coupon.

hasListPrices()

Returns Boolean

Returns true if at least one of the lines has a price. If all prices are POA then no list prices are available.

hasProduct(Product)

Returns Number

Returns the quantity of Product in the Cart.

hasShippingAlert()

Returns Boolean

Returns true if the Cart is unable to determine a shipping cost based on the shipping address.

hasShippingLocation()

Returns Boolean

Returns true if the Cart has a shipping address set.

hasUnknownPrices()

Returns Boolean

Returns true if at any of the lines have no list price i.e. are price on application.

isPurchasable()

Returns Boolean

Returns true if a customer/visitor is able to purchase the Cart contents online, else false - the user may enquire online if the facility is available.

isRecurring()

Returns Boolean

Returns true if the cart contains.

isTaxExemptable()

Returns Boolean

Returns true if a customer may enter a VAT number for tax exemption.

lines()

Returns Array

Returns an Array containing CartLine objects.

paymentMethod()

Returns String

Returns a String containing the payment method used for an order.

postage()

Returns Postage

Returns a Postage object if the cart has a postage option selected, else Null.

requiresShipping()

Returns Boolean

Returns true if the Cart contains physical products that require shipping.

shippingAddress()

Returns Address

Returns the shipping address for the delivery (if applicable).

url()

Returns Url

Returns a Url for the enquiry or order (should not be used for session based carts).