From 94f907e11992f74f9faffdb84ab66cd3ebd03da8 Mon Sep 17 00:00:00 2001 From: Sergei Maertens Date: Mon, 4 Sep 2023 10:20:59 +0200 Subject: [PATCH] :pencil: [#3300] Document appointment creation component --- .../CreateAppointment/CreateAppointment.mdx | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/components/appointments/CreateAppointment/CreateAppointment.mdx b/src/components/appointments/CreateAppointment/CreateAppointment.mdx index bafdfacbd..0bdf79969 100644 --- a/src/components/appointments/CreateAppointment/CreateAppointment.mdx +++ b/src/components/appointments/CreateAppointment/CreateAppointment.mdx @@ -11,9 +11,29 @@ The create appointment UI is used when `form.appointmentOptions.isAppointment` i brings the user in a (mostly) fixed form step progression to select their products, appointment details and provide contact details. -**NOTE** +## Features -This is currently under development. +**Multi vs. single product flow** + +The backend exposes information whether the enabled plugin for appointments supports multi-product +appointments or not. This drives the appointment flow - for multi-product appointments, you can add +additional products and the list of available products is fetched while passing the already selected +products to the backend - this allows only valid combinations to be returned. + +For single-product, the UI is slimmed down a little bit to remove the multi-product controls, and +the "amount" field is fixed to the number "1". + +**Pre-selecting a product** + +You can link to the appointments flow with an optional query string parameter `product`, which +should have the value of a valid product ID. If provided, that product will be pre-selected in the +list of all products. Note that this only applies to the first product in the case of multi-product +forms. + +For example, the following URLs will pre-select a product: + +- `https://example.com/appointment/?product=my-product-id`, for the regular routing +- `https://example.com/#/appointment/?product=my-product-id`, for hash-based routing