Configurator object with its state for any additional data
Items being requested with amounts the user has selected
Configuration options selected by the user
function handleCheckoutItemAmounts(context) {
for (const item of context.demandItems) {
for (const product of item.definition.product_variants) {
Shop.addProductToCart({
id: product.identifier,
count: item.amount * product.amount,
});
}
}
Shop.showToast('Products added to your cart.');
return false;
}
Function that is called during checkout process after the user decided how many items they want, before displaying the contact details form.
Return
falseto prevent displaying the contact details form.This function can be asynchronous (it will be awaited), but does not have to be.