Search.../

getAbandonedCart( )

Gets the current site visitor's shopping cart.

Description

The getAbandonedCart() function returns a Promise that resolves to the specified abandoned shopping cart.

Syntax

function getAbandonedCart(cartId: string): Promise<AbandonedCart>

getAbandonedCart Parameters

NAME
TYPE
DESCRIPTION
cartId

string

ID of the abandoned cart to get.

Returns

Fulfilled - The retrieved cart.

Return Type:

Promise<AbandonedCart>

Was this helpful?

Get an abandoned cart

Code Example

Copy Code
1import wixStoresBackend from 'wix-stores-backend'
2
3export function getAbandonedCart() {
4 return wixStoresBackend.getAbandonedCart();
5}
6
7/* Returned promise resolves to:
8 *
9 * {
10 * "_id": "b5b63fe3-85f0-459a-b90f-7195ebc727f8",
11 * "abandonTime": "2019-06-19T12:20:14.998Z",
12 * "total": "$25.00",
13 * "buyerInfo": {
14 * "id": "f6c0f9c2-a02d-4e9f-a58d-99729af244d9",
15 * "firstName": "John",
16 * "lastName": "Doe",
17 * "email": "john.doe@somedomain.com",
18 * "phone": "5555555555",
19 * "identityType": "CONTACT"
20 * },
21 * "activities": [
22 * {
23 * "type":"EMAIL_SENT",
24 * "timestamp":"2019-11-10T13:57:23.356Z",
25 * "message":"email status has changed to: EMAIL_SENT",
26 * "customData":{
27 * "namespace":"wixstores_email_status"
28 * }
29 * }
30 * ],
31 * "status": "ABANDONED"
32 * }
33 */