Skip to content

updateCount

updateCount is a DOM event that occurs whenever the basket count is updated while using Inpost Pay.

Event body

The updateCount body has a number type which represents the updated basket count. It is optional so it might not exist.

Example

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

useStorefront(async (storefront) => {
    document.addEventListener('updateCount', ({ detail: basketCount }) => {
        console.log('The basket count has been updated to ', basketCount);
    });
});