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
String
The ISO code of currency of the channel at the point of instantiation e.g. GBP or USD. |
created
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
String
The currency ISO code for the Cart object. |
customerReference
String
A purchase order reference given by the customer. Only set on Orders. |
discount
Money
The total discount applied to the cart, either net or gross depending on the taxRule. |
hasCutOff
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
Boolean
Returns true if the cart has any discounts applied. |
id
Number
The system ID for the cart. |
includesTax
Boolean
Returns true if the cart's taxRule is set to includingTax, else false. |
isCart
Boolean
True if the type of the object is cart. |
isCustomShipping
Boolean
True if an administrator has applied custom shipping costs to a cart or order. |
isEnquiry
Boolean
True if the cart type is set to enquiry. |
isOrder
Boolean
True if the cart type is set to order. |
isQuote
Boolean
Not yet implemented. |
isTaxExempt
Boolean
True if the cart has a valid taxNumber. |
ordered
Date
The date an order was placed. This is applicable to orders only and contains a null value for carts. |
postageMethod
String
Returns the String name of the postage method. |
quickfind
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
Money
Not yet implemented. |
recurringShipping
Money
Not yet implemented. |
recurringSubtotal
Money
Not yet implemented. |
recurringTax
Money
Not yet implemented. |
recurringTotal
Money
Not yet implemented. |
reference
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
Money
The total cost of shipping either net or gross depending on the taxRule. |
source
String
The original source of where the cart, enquiry or order was instantiated. This property is important in segmenting order activity by:
|
status
String
The status of the Cart object is relevant only to orders and enquiries. |
subtotal
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
Money
The total tax levied on the cart. |
taxNumber
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
Boolean
True if the VAT number provided by the customer was verified. False if not. |
taxRule
String
The tax rule for the cart may be:
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
Money
The gross total for the cart. |
type
String
The type of sales document:
|
weight
Number
The gross shipping weight of the cart in kg. |
Methods |
---|
allowCoupons()
Boolean
Returns true if promotional discount coupons are available to be added to the Cart. |
availablePostage()
Array
Returns an Array of available Postage options. |
billingAddress()
Address | null
Returns the billing address for the customer. |
convertedFrom()
Cart | null
Returns the originating object the Cart object was converted from, or Null. |
coupon()
Discount | null
Returns a Discount object if the cart contains a discount coupon, else Null. |
creditcard()
Object | null
Returns an Object containing the card for the order:
If the Note: we do not hold full card data anywhere in our platform. |
customer()
Contact | null
Returns a Contact object containing the customer details for the Cart object. |
hasAvailablePostage()
Boolean
Returns true if the Cart has available postage options. |
hasCoupon()
Boolean
Returns true if the Cart contains a discount coupon. |
hasListPrices()
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)
Number
Returns the quantity of Product in the Cart. Parametersproduct
Product
The Product object to search for within the sales document. |
hasShippingAlert()
Boolean
Returns true if the Cart is unable to determine a shipping cost based on the shipping address. |
hasShippingLocation()
Boolean
Returns true if the Cart has a shipping address set. |
hasUnknownPrices()
Boolean
Returns true if at any of the lines have no list price i.e. are price on application. |
isPurchasable()
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()
Boolean
Returns true if there are recurring fees. |
isTaxExemptable()
Boolean
Returns true if a customer may enter a VAT number for tax exemption. |
lines()
Array
Returns an Array containing CartLine objects. |
paymentMethod()
String
Returns a String containing the payment method used for an order. |
postage()
Postage
Returns a Postage object if the cart has a postage option selected, else Null. |
requiresShipping()
Boolean
Returns true if the Cart contains physical products that require shipping. |
shippingAddress()
Address | null
Returns the shipping address for the delivery (if applicable). |
url()
Url
Returns a Url for the enquiry or order (should not be used for session based carts). |