Search.../

onCartRecovered( )

Deprecated. This event will continue to work until September 4, 2024, but a newer version is available at wix-ecom-backend.Events.onAbandonedCheckoutRecovered().

We recommend you migrate to the new Wix eCommerce APIs as soon as possible.

Description

An event that fires when a visitor completes a purchase from an abandoned shopping cart.

The onCartRecovered() event handler runs when a visitor completes a purchase more than 1 hour after items have been added to a shopping cart.

You can use this event to cancel planned communications with the visitor who abandoned the shopping cart.

Note: Backend events don't work when previewing your site.

Syntax

function onCartRecovered(event: CartRecoveredEvent): void

onCartRecovered Parameters

NAME
TYPE
DESCRIPTION
event
CartRecoveredEvent

Information about the cart that was recovered.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

An event when an abandoned shopping cart is recovered

Copy Code
1// Place this code in the events.js file
2// of your site's Backend section.
3
4export function wixStores_onCartRecovered(event) {
5 let cartId = event.cartId;
6 let recoveredTime = event.recoveredTime;
7}
8
9/* Full event object:
10 *
11 * {
12 * "cartId": "60349781-b3hf-4349-8c9e-09492063da9",
13 * "creationTime": "2019-01-23T11:28:22.328Z",
14 * "abandonTime": "2019-01-23T12:28:02.373Z",
15 * "recoveredTime": "2019-01-23T12:58:02.373Z"
16 * }
17 *
18 */