Ravak Configurator
    Preparing search index...

    Type Alias CheckoutInitCallback

    CheckoutInitCallback: (
        context: {
            configurator: Configurator;
            demandItems: DemandItemAPIModel[];
            selectedOptions: ParameterOptions;
            totalAmount: number;
        },
    ) => false
    | Promise<false>
    | unknown

    Function that is called when the user initializes the checkout process, before even displaying the checkout form.

    Return false to prevent displaying the default checkout form.

    This function can be asynchronous (it will be awaited), but does not have to be.

    Type declaration

      function handleCheckoutInit(context) {
    for (const item of context.demandItems) {
    for (const product of item.definition.product_variants) {
    Shop.addToCart({
    id: product.identifier,
    count: context.totalAmount * item.amount * product.amount,
    });
    }
    }
    Shop.showToast("Products from the configuration added to your cart.");
    return false;
    }