Example Description
In this example, a site visitor can request a service booking using a simple quick book form. An admin can view all of the requested bookings and decide which ones to approve and which ones to decline.
How We Built It
The Collection We Added: pendingAppointments
We created the pendingAppointments collection with the following fields:
Email: The email address of the visitor requesting a service booking
Name: The name of the visitor requesting a service booking
Age: The age of the visitor requesting a service booking
Status: The status of the booking request - PENDING, APPROVED, or DISMISSED
RequestedSlot: The JSON object of the requested booking slot
The pendingAppointments collection maintains all the requested booking information. Each item in the collection is a booking requested by a site visitor. We store the selected slot object because it is needed when using the Bookings API to book a service.
Requesting a Service Booking
To request a service booking, site visitors click on the Book Consultation button on the home page. A lightbox appears on the side of the page with a simple quick booking form. In a single form, screen visitors enter their personal information and choose a booking slot. The available slots are retrieved using the Bookings API. When a booking request is made, the request is stored in the pendingAppointments collection as pending.
Approving and Declining Pending Appointments
On the Pending Appointments page, all pending and declined appointments in the pendingAppointments collection are displayed in a pair of repeaters. Pending appointments can be approved or declined. When an appointment is declined, it is moved from the pending list to the declined list. When an appointment is approved, the data stored in the pendingAppointments collection is used with the Bookings API to book the requested slot.
Next Steps
Open this example in the Editor to work with the template.
Publish the site and refresh your browser so the Bookings collections appear in the Database.
Learn how to work with examples in Velo.
Related Examples
Did this help?
|
Thanks for your feedback!
Service Page
Create a custom service page with related products for sale.
Intermediate
Service List
Filter a list of services and view the next available slot.
Intermediate