Introduced in v3.0.0 to fire when a section is refreshed. The current theme no longer dispatches this event.
API for apps and custom code (JS events)
Updated today
The theme dispatches these DOM events for apps and custom code to listen to:
Event | Triggered when |
|---|---|
| A quantity input is updated. |
| A product's selected variant changes. |
| The cart returns an error. |
| The cart is updated. |
| A discount code is removed from the cart. |
| The quick-add modal is closed. |
| The |
section-refreshed (removed)
Listen to an event
window.addEventListener("quantity-update", (e) => {
console.log("The quantity input has been updated. Here's the event: ", e);
});
// or, scoped to one element
const myElement = document.querySelector('.my-element');
myElement.addEventListener("quantity-update", (e) => {
console.log("My quantity input has been updated. Here's the event: ", e);
});Was this helpful?
Was this helpful?