onCollectionUpdated( )


An event that fires when a product collection is updated.

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

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

Method Declaration
Copy
function onCollectionUpdated(event: CollectionUpdatedEvent): void;
Method Parameters
eventCollectionUpdatedEventRequired

Information about the product collection that was updated.

An event when a product collection is updated
JavaScript
// Place this code in the events.js file // of your site's Backend section. export function wixStores_onCollectionUpdated(event) { let collectionId = event.collectionId; let firstUpdatedField = event.updateFields[0]; } /* Full event object: * * { * "collectionId": "1a2d7e83-4bef-31d5-09e1-3326ee271c09", * "updatedFields": [ * "name", * "media" * ] * } * */
Errors

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

Did this help?