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