Any data that is sent with the event can be found in the event.detail property when writing an event handler.

status:cart:add

Example

document.addEventListener('status:cart:add', (event) => {
  console.log(event)
});

This is fired when we add an item to the Shopify cart using the Shopify cart API.

Data

This event returns the cart response we get from Shopify.


status:cart:open

Example

document.addEventListener('status:cart:open', (event) => {
  console.log(event)
});

This is fired when a user clicks a “Go to cart” button in our app. If you have an alternate cart and don’t use the default Shopify cart page, you can hook into this event to trigger your cart to open. By default, the features that have a “Go to cart” button will redirect to the cart page. This can be disabled by contacting customer support and letting them know that you’d like to disable the cart redirect.

Data

This event does not return data.


status:widget:open

Example

document.addEventListener('status:widget:open', (event) => {
  console.log(event)
});