onProductUpdated( )


An event that fires when a product is updated.

The onProductUpdated() event handler runs when a product is updated in a store.

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

Method Declaration
Copy
function onProductUpdated(event: ProductUpdatedEvent): void;
Method Parameters
eventProductUpdatedEventRequired

Information about the product that was updated.

An event when a product is updated
JavaScript
// Place this code in the events.js file // of your site's Backend section. export function wixStores_onProductUpdated(event) { let productId = event.productId; let firstUpdatedField = event.updateFields[0]; } /* Full event object: * * { * "productId": "1a2d7e83-4bef-31d5-09e1-3326ee271c09", * "updatedFields": [ * "name", * "productOptions", * "description", * "price", * "slug", * "ribbon", * "brand", * "customTextFields", * "media", * "productPageUrl", * "manageVariants", * "discount", * "additionalInfoSections" * ] * } * */
Errors

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

Did this help?