Shopping Cart

For help working with this record in the UI, see Shopping Cart and Checkout Setup.

The internal ID for this record is shoppingcart. You can use the UI to create saved searches with data from the shopping cart. Go to Lists > Search > Saved Searches > New > Shopping cart.

For information about scripting with this record in SuiteScript, see the following:

Supported Script Types

The shopping cart record is scriptable in server SuiteScript only.

Supported Functions

The shopping cart record is not fully scriptable. Only search is permitted.

Usage Notes

You can use SuiteScript to create sophisticated marketing campaigns based upon the data linked to the shopping cart. The following data points are exposed through SuiteScript: customer ID, date created, date edited, item IDs for cart items, and website ID.

Note:

Because shopping carts can be created by anonymous shoppers, in some search results the customer ID may be null.

Script Samples

The following example uses the search.create(options) method to get shopping cart information.

To get carts from a certain website (id:1) which contains a particular item (item id:352), use the following code sample:

          var mySearch = search.create({
    type: search.Type.SHOPPING_CART,
    filters: [{
        name: 'websiteid',
        operator: search.Operator.EQUALTO,
        values: '1'
    }, {
        name: 'itemid',
        operator: search.Operator.EQUALTO,
        values: '352'
    }],
    columns: [{
        name: 'itemid'
    }, {
        name: 'itemqty'
    }, {
        name: 'websiteid'
    }, {
        name: 'customerid'
    }]
});
mySearch.run().each(function(result){
    var name = result.getValue({
        name: 'fullurl'
    });
    var site = result.getValue({
        name: 'addtohead'
    });
    var pageType = result.getValue({
        name: 'subcataddtoheadoverride'
    });
    return true;
}); 

        

Related Topics

Shopping Cart and Checkout Setup
Working with the SuiteScript Records Browser
SuiteCloud Supported Records
Website
CMS Content
CMS Content Type
CMS Page
Commerce Category
Website Setup

General Notices