Search...
onCollectionUpdated( )
An event that fires when a product collection is updated.
Description
The onCollectionUpdated()
event handler runs when a product collection
is updated in a store.
Note: Backend events don't work when previewing your site.
Syntax
function onCollectionUpdated(event: CollectionUpdatedEvent): void
onCollectionUpdated Parameters
NAME
TYPE
DESCRIPTION
event
CollectionUpdatedEvent
Information about the product collection that was updated.
Returns
This function does not return anything.
Return Type:
void
Was this helpful?
An event when a product collection is updated
Copy Code
1// Place this code in the events.js file2// of your site's Backend section.34export function wixStores_onCollectionUpdated(event) {5 let collectionId = event.collectionId;6 let firstUpdatedField = event.updateFields[0];7}89/* Full event object:10 *11 * {12 * "collectionId": "1a2d7e83-4bef-31d5-09e1-3326ee271c09",13 * "updatedFields": [14 * "name",15 * "media"16 * ]17 * }18 *19 */