Skip to content

optionsUpdated

optionsUpdated is a DOM event that occurs whenever the options of products in a bundle get updated due to selecting variants inside them.

Event body

The optionsUpdated body has a BundleItemData type which represents the details of the updated overall bundle data. It is optional so it might not exist.

Example

In this example we listen to optionsUpdated event and perform an action whenever it's emitted.

useStorefront(async (storefront) => {
    document.addEventListener('optionsUpdated', (event) => {
        const bundleItemData = event.detail;

        console.log('A bundle item data has changed:', bundleItemData);
    });
});