Search.../

onProductDeleted( )

An event that fires when a product is deleted.

Description

The onProductDeleted() event handler runs when a product is deleted from a store.

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

Syntax

function onProductDeleted(event: ProductDeletedEvent): void

onProductDeleted Parameters

NAME
TYPE
DESCRIPTION
event
ProductDeletedEvent

Information about the product that was deleted.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

An event when a product is deleted

Copy Code
1// Place this code in the events.js file
2// of your site's Backend section.
3
4export function wixStores_onProductDeleted(event) {
5 let productId = event.productId;
6}
7
8/* Full event object:
9 *
10 * {
11 * "productId": "5096485f-0239-3881-3f6a-63955708a4ec"
12 * }
13 *
14 */