Intercept or cancel the Checkout redirect
instantCheckout event is dispatched when the storefront is about to redirect the user to the checkout page. It is cancelable, allowing developers to implement custom logic before manually triggering the redirect using the checkoutUrl provided in the event detail.document.addEventListener('instantCheckout', (e) => {
// Cancel the default redirect
e.preventDefault();
// Insert custom logic here
// Manually redirect to the checkout URL
window.location.href = e.detail.checkoutUrl;
});