How to Build a Class Booking System with Acuity Scheduling
This article was sponsored by Acuity Scheduling. Thank you for supporting the partners who make SitePoint possible.
I recently wrote an article about building an online system to book lessons with a driving instructor. Teaching someone to drive is relatively unique, in that it's guaranteed to be a one-to-one class — or at least, if you did find yourself sharing an instructor's time, then you'd have every right to feel short-changed.
Most other types of class, though, tend to have multiple participants. Unless they're delivered online, they'll most likely have a limit on the number of students due to logistical considerations.
Cookery classes usually have a very well-defined limit on the number of students — you can only really teach as many people as you have cooking stations or cookers. That's going to be the theme of this article — managing those "slots" in a cookery class. The principles remain the same for all sorts of other forms of tuition.
As before, we're going to take advantage of Acuity Scheduling in order to manage bookings for our classes, and everything that entails.
All of the code for this tutorial is available on Github.
What We're Going to Build
Thanchanok delivers Thai cookery classes. There's a general introductory course, as well as two more specialised courses - one covering the many and varied Thai curry pastes, and one that focuses specifically on the region in which she was brought up — the swelteringly hot Northern region around Chiang Mai. She owns a specially fitted-out kitchen to deliver these classes. Each has eight cooking stations. She typically runs around four classes a week — two of those slots for the introductory class which, as you might expect, is by far her most popular.
Currently her website includes an email address and telephone number for making bookings, but there are a number of issues with that. First is that it's easy to forget to update the website to indicate that it's fully-booked, which on occasion has left potential attendees disappointed and with a poor impression of the company.
The second is that she has to rely on good old-fashioned pen-and-paper to manage her list of pupils, along with their contact details and whether they've paid for the lesson ahead of time. She'd very much like to add a feature to her website that allows people to view class availability as well as book online, and to then help her class schedule and attendee lists. That's what we're going to do in the course of this tutorial.
Let's break down the requirements as far as the public-facing website is concerned:
- The website needs to show all of the upcoming classes.
- If a class is fully booked, it needs to say so.
- Classes not fully booked should show the number of available slots.
- Visitors should be able to book a place on classes that have availability.
By integrating all of this with Acuity Scheduling, we effectively get the back-end requirements handled without having to develop it ourselves:
- The number of people who've booked for each upcoming class.
- A list of attendees, along with their contact details.
- Constant updates about upcoming classes and bookings.
- Thanchanok's calendar, all in one place.
Let's get started.
Setting Up Acuity Scheduling
The first thing you'll need to do, if you haven't already, is to sign up at Acuity Scheduling. The free trial will be perfectly adequate for following along.
The next thing we need to do is set up the three classes. In Acuity terminology these are appointment types.
If you've just signed up, click the Create your Appointment types button at the top of the screen, or click Appointment Types under Business Settings on the sidebar.
Next, click the New Type of Group Class button.
You'll need to name the class. For the purposes of this tutorial we'll call them Introduction to Thai Cookery, Thai Curry Pastes and
Truncated by Planet PHP, read more at the original (another 11695 bytes)