I often recommend the WooCommerce Bookings Extension, to clients who want to sell bookable products, on their site. So, what is a bookable product? An event, or say a rental, or an appointment, is an example of a product which can be booked. If you were using this plugin, or were considering using it, I’d like to make you aware of one major limitation:
The possibility to “Search Available Products”, before booking one.
Let me explain. When setting up a hotel website for a client, he put forth this requirement. He needed a search option, which allowed users, to check available rooms, before booking one. The search option wouldn’t be part of a particular product (room), but would rather have to be present on every page of the site. The most reasonable solution was to create a search widget, to check availability of bookable products.
Creating a Availability Search Widget
The widget was simple to create. I had to create the usual widget in WordPress. Do note, since the requirement was to create the widget as part of the theme, I had to add the widget registration code, in functions.php of my theme file. If you wanted to make an extension plugin, you will have to add in your plugin file.

Room Availability Check Widget Interface
- The widget would add two input fields, for ‘Check-in’ and Check-Out’ dates. Each field could be filled using a datepicker. The datepicker provided was a normal datepicker, and not the one provided by the WooCommerce Bookings extension.
- There was a search button, ‘Check Availability’ provided, which a visitor could use to perform the search results.
- The admin settings for the plugin, allowed the client, to change the labels for the input fields and the search button.
- When a visitor performed an availability search on the site, the results were displayed on a separate page.
Simple, Right?! But how is the search actually performed?
Read on.
Bookable Product: Using Max Bookings Per Block
The WooCommerce Bookings extension provides a field for every Bookable product, “Max Bookings Per Block”. This field gives an indication of the number of bookable products available. As an example, let’s take the same scenario forward. The client, had several room types, e.g. Royal Suites, Suites, King, Queen and Double, and several rooms for each room type.
He had a total of 5 Royal Suites. Instead of creating 5 different bookable products, he only had to create a single Bookable Product – ‘Royal Suite’, and set ‘Max Bookings Per Block’ as 5.
Checking Availability of WooCommerce Booking
The WooCommerce Bookings extension, then maintains the availability based on the number of products booked.
- The Bookings extension uses the ‘Max Bookings Per Block’ value, to indicate the availability of the room.
- After clicking on the check availability button in the search widget, a database query will be made to check bookable products.
- The availability of the product is checked, for every date between the Check-in and Check-Out dates.
- If a product (room), is available on all days, then it will be selected, and displayed on the search results page.
- A product which has not been booked at all, will also be shown in the search results.
For the client’s project, this criteria was sufficient. But you could consider adding more features.
Adding Filter and Sorting Options
To improve user experience on your site, you can surely add sorting and filtering options. Most websites have these options to make it simpler for visitors to find a product, they are more likely to book.
- The ‘Availability Search’ widget can be extended, to include a filter for room types, or the number of rooms to be booked.
- Options can also be added on the search results page to sort results based on the price of the rooms.
Conclusion
This custom ‘Availability Search’ extension, can be a great addition to any site, which uses WooCommerce Bookings. It adds to better user experience and improved likelihood of customer conversion. Are you thinking of providing this feature on your site, but have trouble implementing it? You can leave your queries in the comment section below, and we can try helping you out.
António Pinto :
In case anyone comes here and wants a sample code to start, I’ll leave here this.
Please note this is almost pseudo code, it only serves to explain the “how to do it” and does not attempt to be “The Way” to do it.
The code NEEDS to be refined in order to work as expected.
António Pinto :
Ops… forgot the link 😉
https://gist.github.com/apintocr/65715de169d0e640d7c95e283b8d0183
Santiago :
Hello Karthik,
Sorry for the late response. Actually, this have sense if after search and select the item to book, this info is pulled to the calendar, so the client dosen’t need to click on dates for a second time.
Do you think is this possible too?
Thanks Santiago Helmann
Karthik Thayyil :
Yes Santiago, this is possible.
Karthik Thayyil :
Yes Santiago. If you’re looking for this feature we can customize the plugin for you.
Santiago Helmann :
Hello karthik,
Fantastic. Do you have an email where I can be in contact with you?
Thanks
Santiago Helmann
Karthik Thayyil :
Hi Santiago,
It would help if you could send details of your requirement to [email protected]
Santiago :
Hello Karthik,
What do you mean, can you develope it for me?
Thanks
Santiago Helmann
Santiago Helmann :
Hello Team, Is it possible to combine the search with other filters like attributes or categories?
Karthik Thayyil :
Hi Santiago,
The plugin we’ve built: Availability Search for WooCommerce Bookings, does not provide this feature. But it should be possible to add it.
gfardoux :
hi, i really need this king of extension, how can i do please ? thanks for help 🙂
Praveen Chauhan :
Hi Germain,
The effort to build such an extension is about 20 Hours. If you are interested, you can contact us via the contact form on our site.
Ramses :
I have upgraded my plugin and see that this widget is in there. I am wondering if it is possible to add a category filter.
I am renting out rooms in different states, and would like to search by state if possible. Can someone maybe push me in the right direction?
Thanks!
Ramses – the Netherlands
Praveen Chauhan :
Hi Ramses,
I did not find the availability search widget. Which version of WC Bookings are you using?
Will :
HI I’m interested in this as well – have someone connect with me to know the costs.
Praveen Chauhan :
Hi Will,
A person from our team will contact you soon.
Will :
Hi thanks never heard back from anyone
Praveen Chauhan :
Hi Will,
I’ve informed the team again. They will get back to you asap.
MIndTag :
Please contact us, we have a client that needs this!
Jose R. Lopez :
Hey, great writeup. I am very much interested in this customization exactly as described. Could you have someone get in touch with pricing information? Thanks!
Praveen Chauhan :
Hi Jose,
Thank-you 🙂 I’ve forwarded your contact to the Business Development team, they will contact you soon.
Heather :
This sounds great but how do I implement it? I don’t see a link to download the code.
Praveen Chauhan :
Hi Heather,
The WooCommerce Bookings Extension, does not provide enough hooks to provide a reusable solution. So, we provide it as a custom solution.
Heather :
Please tell me more about that. How much is it, do you have an example, etc… I am looking to get something implemented asap.
Praveen Chauhan :
Hi Heather,
Thank you for contacting us. A person from our team will contact you shortly.
Brian :
Your widget is exactly what I’m looking for!
Building a site for a client and nearly finished – using the woocommerce bookings extension. Everything works supremely well with the exception that the widget you wrote about is not provided by Woo and I don’t have the coding experience necessary to to add it.
The client manages over 90 vacation rental properties and every other filter and search I’ve loaded into the site works beautifully to narrow a search down to the nth degree, but without that availability widget somewhere on the site, the prospective customer has to look at the availability calendar for each property to determine if that is going to fit their vacation plans. Clearly not a good solution as one or more results that don’t meet their vacation plans will result in them going somewhere else (plenty of competition in the area, so we need to keep em when we get em on the site)
Your assistance would be greatly appreciated.
Thank you for stepping up to the plate with this solution!
Praveen Chauhan :
Hi Brian,
Thank you for your comment. Yes the availability search is a limitation of the WooCommerce Bookings extension. We would be happy to help you. Someone from our team will contact you soon enough.