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