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.
function onProductDeleted(event: ProductDeletedEvent): void;
Information about the product that was deleted.
// 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"
* }
*
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.