Fluorescent
Flash Cart
Flash Cart
  • Flash Cart Help Center
    • Get Started
    • FAQ
    • Support
  • Cart components
    • Quick cart
      • Cart density
      • Cart summary area
      • Cart title
      • Empty cart promotion
      • Sidebar style
    • Added-to-cart popup
    • Floating cart icon
    • Quick purchase bar
      • Customize quick purchase bar
      • Promotion banner
  • Cart Blocks
    • Using cart blocks
    • Cart items
      • Item images
      • Item savings
      • Live traffic label
      • Low inventory warning
      • Unit prices
    • Cross-sells
      • Global cross-sells
      • Handpicked cross-sells
      • Automatic recommendations
      • Cross-sells: Tips and tactics
      • Analytics
    • Free shipping bar
    • Payment icons
    • Text bar
    • Text list with icons
    • App embeds
    • Custom Liquid
  • Style settings
    • Colors
    • Fonts
    • Custom CSS
  • For Developers
    • API custom events
    • Configuration options
Powered by GitBook
On this page
  • Trigger events
  • Close cart
  • Open cart
  • Refresh cart
  • Rebind actions on cart
  • Emitted events
  • Cart initialized
  • Cart updated
  • Cart opening
  • Cart opened
  • Cart closing
  • Cart closed
  • Product added to cart
  • Product quantity updated
  • Upsell data updated
  1. For Developers

API custom events

PreviousCustom CSSNextConfiguration options

Last updated 1 year ago

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 .

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:close

Open cart

// This event opens the cart
obsidian:upsell:open

Refresh cart

// This event refreshes the cart
obsidian:upsell:refresh

Rebind actions on cart

// This event rebinds actions on cart, if changed externally
obsidian:upsell:rebind

Emitted events

These events are emitted by Flash Cart when something occurs.

Cart initialized

// Emitted on completion of initialization of the cart
obsidian:upsell:initialized

Cart updated

// Emitted when cart is updated
obsidian:upsell:updated

Cart opening

// Emitted when cart is instructed to open, but has not finished
obsidian:upsell:opening

Cart opened

// Emitted when cart is opened
obsidian:upsell:opened

Cart closing

// Emitted when cart is instructed to close, but has not finished
obsidian:upsell:closing

Cart closed

// Emitted when cart is closed
obsidian:upsell:closed

Product added to cart

// Emitted when product added to cart
obsidian:upsell:added

Product quantity updated

// Emitted when quantity of a product in cart is changed
obsidian:upsell:quantity

Upsell data updated

// Emitted when the upsells data changes 
obsidian:upsell:upsells:update

Shopify Experts