Allows visitors to book a hike with the Wix Bookings API.
In this example, we demonstrate how to create a customized booking experience using the Wix Bookings API. Visitors can select a hike, enter their contact details, and proceed to checkout easily.
To use this example:
We added the following to our site:
On the home page, the repeater is populated with hike options to book by connecting it to the Wix Bookings Services app collection. The “Book Now” buttons direct the visitor to a dynamic page with the relevant hike’s details.
The code in this file initializes the page’s elements and retrieves availability data for the selected hike from the backend.
In this file, we:
The code in this file manages the booking process using the Wix Bookings API. We defined the following methods:
queryAvailability()
: This method queries and returns the available booking slots for the specified hike.createBooking()
: This method accepts booking details collected from the booking form and creates a booking. It then returns the result to confirm that the booking was successful.The code in this file handles the checkout process using the Wix Ecom API. We defined the following methods:
createCheckout()
: This method begins the checkout process, allowing visitors to complete their payment for the booking.getCheckoutUrl()
: This method retrieves the checkout URL for the booking transaction, which directs visitors to pay for their booking.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.