Any data that is sent with the event can be found in the event.detail
property when writing an event handler.
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.
This event returns the cart response we get from Shopify.
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.
This event does not return data.
Example
document.addEventListener('status:widget:open', (event) => {
console.log(event)
});