Allow visitors to select and book available theater seats.
In this example, we create a theater reservation system to demonstrate how to read and write data in a Wix collection with the Wix Data API. We retrieve and display seat data, allowing visitors to select an available seat by visual representation, and then update the collection based on the visitor’s selection.
We added the following to our site:
Theater Seats: A collection containing the theater’s seat numbers, price, and availability.
The code in this file handles the retrieving, displaying, and reserving of theater seats.
In this file, we:
The code in this file manages the seat reservation process in the backend by updating the Theater Seats collection.
We defined the following method:
reserve()
: This method accepts an array of the visitor’s selected seats, updates the Theater Seats collection, and then returns a confirmation message or an error to the frontend. Elevation is necessary to allow updates to the seat availability in the collection during the reservation process, without requiring individual permissions for each visitor.Join the Wix Studio community on Discord, where experienced developers and fellow creators come together to share tips, troubleshoot issues, and collaborate.
Building a coded solution on your own can be challenging. Let an experienced Wix developer build it for you, so you can keep working on your site or business. Visit the Wix Marketplace to find a trusted developer.