• Execute tasks before the actual checkout. Optionally the checkout can also be cancelled.
    The checkout is waiting until all listeners are finished or the timeout has elapsed.

    Example

    CfgrUtils.onBeforeCheckout(async ({ shopInput }) => {
    if (shopInput !== 'Save') {
    const success = createFinalPdf();
    if(!success) {
    showErrorNotification();
    return false; // prevent checkout
    }
    }
    });

    Parameters

    • listener: OnBeforeCheckoutListener

      The function to be executed.
      If any listener returns false it will cancel the checkout.

    • Optional timeoutMS: number

      Timeout value in ms.
      When running into the timeout it will proceed with the checkout and not cancel it!
      If it should cancel, it has to be implemented in the listener itself.

    Returns void

Generated using TypeDoc