An event that fires when a product collection is created.
The onCollectionCreated()
event handler runs when a product collection
is added to a store.
Note: Backend events don't work when previewing your site.
function onCollectionCreated(event: CollectionCreatedEvent): void;
Information about the product collection that was created.
// Place this code in the events.js file
// of your site's Backend section.
export function wixStores_onCollectionCreated(event) {
let collectionId = event._id;
}
/* Full event object:
*
* {
* "name": "New Collection",
* "_id": "a7698dfb-12e8-1bd6-cdc1-0116554f18d1",
* "mainMedia": "wix:image://v1/c...8.jpg/file.jpg#originWidth=2700&originHeight=2186"
* }
*
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.