> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: onCartDeleted(event: CartDeleted) # Method package: wixEcomBackend # Method menu location: wixEcomBackend --> onCartDeleted # Method Link: https://dev.wix.com/docs/velo/events-service-plugins/e-commerce/events/on-cart-deleted.md # Method Description: An event that triggers when a cart is deleted. The onCartDeleted() event handler runs when a cart is deleted. The received `CartDeleted` object contains event metadata. > **Note:** Backend events don't work when previewing your site. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## An event fired when a cart is deleted ```javascript // Place this code in the events.js file // of your site's Backend section. // Add the file if it doesn't exist. export function wixEcom_onCartDeleted(event) { const cartId = event.metadata.entityId; console.log('Cart deleted', event); } /* Full event object: * * { * "metadata": { * "id": "c3500825-f582-4755-81b3-fa55b8585e5c", * "entityId": "19716650-fd62-4e3a-b98b-7e196d0e88a3", * "eventTime": "2022-07-28T08:36:02.227138Z", * "triggeredByAnonymizeRequest": false * } * } * */ ``` ---