Cart object returned as JSON.

For familiarity we have tried to ensure consistency in terminology with the Cart object.

Example using JQuery

    jQuery.getJSON('/cart.json', function(returnValue) {


If your website has multiple languages you will want to ensure results are returned in the language, country and currency of your locales. To achieve this you can localise the URL as follows.

In your EVML view file:

<div id="myDiv" data-url="@/cart.json"></div>

Within your view's JavaScript file:

    var myDiv = jQuery('#myDiv');
    jQuery.getJSON(myDiv.attr('data-url'), function(returnValue) {
    } );

With the code above it won't matter which locale you visit the URL and results will be correct.

Accepted Parameters

The script allows you to define the following optional parameters.


An EVML include/partial to render per result. You may supply one fragment to render only. The fragment path should be supplied in the format controller/filename. For example in many themes the file cart/mini.partial.evml is available. This may be supplied as /cart.json?fragment=cart/mini.partial

Returned Object

The script returns an object with the following properties.


Returns an Array of available Postage options.


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


200 if the request was successful, or 400 if the request was bad.


If the cart contains a discount coupon, the Discount object is returned.
else Null.


The date the cart was created on.


The currency ISO code for the Cart object.


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


If you specify a fragment parameter a fragment property will be available containing the rendered partial. This is an ideal way of quickly building HTML from your Ajax queries using the Theme engine rather than through JavaScript. Note that the fragment parameter supplied must be a legitimate cart partial/include. The cart is supplied to the fragment file as a fully qualified Cart Object within a cart variable.


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.


Returns true if the cart has any discounts applied.


The system ID for the cart.


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


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


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.


Returns true if the cart contains a product which is of type 'Subscription'.


Returns true if the cart has a valid taxNumber.


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


An array item for each cart line is built up containing the properties of the CartLine object.


The name of the postage method.


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


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

  • website
  • telesales

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.


The total tax levied on the cart.


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.


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


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.


The gross total for the cart.


The gross shipping weight of the cart in kg.

COVID-19 NOTICE – Business as Usual
Evance continues to provide all services and support throughout this difficult period. See our full statement here