API custom events
We do not support code customizations. This guide offers a basic reference for developers. Always test code changes on a duplicated, unpublished version of your theme. For assistance, we recommend finding a professional developer through Shopify Experts.
We built an event-based API so developers can easily hook into Flash Cart and add their own functionality. Events are an easy mechanism for apps to talk to each other. Below you’ll find trigger events to make Flash Cart take an action, and events emitted by Flash Cart that your app can receive.
Trigger events
These events can be emitted programmatically to trigger Flash Cart to take an action.
Here’s an example call that uses the Refresh cart event.
const myRefreshEvent = new Event('obsidian:upsell:refresh')
document.dispatchEvent(myRefreshEvent)Close cart
// This event closes the cart
obsidian:upsell:closeOpen cart
// This event opens the cart
obsidian:upsell:openRefresh cart
// This event refreshes the cart
obsidian:upsell:refreshRebind actions on cart
// This event rebinds actions on cart, if changed externally
obsidian:upsell:rebindEmitted events
These events are emitted by Flash Cart when something occurs.
Cart initialized
// Emitted on completion of initialization of the cart
obsidian:upsell:initializedCart updated
// Emitted when cart is updated
obsidian:upsell:updatedCart opening
// Emitted when cart is instructed to open, but has not finished
obsidian:upsell:openingCart opened
// Emitted when cart is opened
obsidian:upsell:openedCart closing
// Emitted when cart is instructed to close, but has not finished
obsidian:upsell:closingCart closed
// Emitted when cart is closed
obsidian:upsell:closedProduct added to cart
// Emitted when product added to cart
obsidian:upsell:addedProduct quantity updated
// Emitted when quantity of a product in cart is changed
obsidian:upsell:quantityUpsell data updated
// Emitted when the upsells data changes 
obsidian:upsell:upsells:updateLast updated
