Search.../

onProductUpdated( )

An event that fires when a product is updated.

Description

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

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

Syntax

function onProductUpdated(event: ProductUpdatedEvent): void

onProductUpdated Parameters

NAME
TYPE
DESCRIPTION
event
ProductUpdatedEvent

Information about the product that was updated.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

An event when a product is updated

Copy Code
1// Place this code in the events.js file
2// of your site's Backend section.
3
4export function wixStores_onProductUpdated(event) {
5 let productId = event.productId;
6 let firstUpdatedField = event.updateFields[0];
7}
8
9/* Full event object:
10 *
11 * {
12 * "productId": "1a2d7e83-4bef-31d5-09e1-3326ee271c09",
13 * "updatedFields": [
14 * "name",
15 * "productOptions",
16 * "description",
17 * "price",
18 * "slug",
19 * "ribbon",
20 * "brand",
21 * "customTextFields",
22 * "media",
23 * "productPageUrl",
24 * "manageVariants",
25 * "discount",
26 * "additionalInfoSections"
27 * ]
28 * }
29 *
30 */