onProductDeleted( )


An event that fires when a product is deleted.

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

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

Method Declaration
Copy
function onProductDeleted(event: ProductDeletedEvent): void;
Method Parameters
eventProductDeletedEventRequired

Information about the product that was deleted.

An event when a product is deleted
JavaScript
// Place this code in the events.js file // of your site's Backend section. export function wixStores_onProductDeleted(event) { let productId = event.productId; } /* Full event object: * * { * "productId": "5096485f-0239-3881-3f6a-63955708a4ec" * } * */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?