Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

How to prevent booking on certain dates with WooCommerce

It happens at times when you stand in need to block a few days mostly public holidays from your booking calendar. In those scenarios, certain days can be selectively stopped from appearing on your booking calendar with the WooCommerce Booking and Appointment Plugin. In this post we are going to see how to prevent booking on certain dates with WooCommerce.

Blocking Dates with WooCommerce Booking & Appointment Plugin: Admin Experience

We will take the example of Spa appointments for this post.

The first step will be creating your appointment product. You can do that from the Products -> Add Product link. On the same page, you would also find the Booking meta box that allows you to setup your appointment. Then you have to do some general booking settings.

Prevent booking on certain dates with WooCommerce - General Booking Settings
General Booking Settings

Under the “Booking options” tab, I have selected the Enable Booking Date. Under Select Booking Method, I have selected Recurring Weekdays. And all Booking Days are also selected.

Once this is done, there is an option called Enable Booking Time in the “Booking Options” tab. You need to enable this in order to add time slots.

Prevent booking on certain dates with WooCommerce - Enable Booking Time
Enable Booking Time
You can add new time slots by clicking on the “Add Time Slot” button. The Lockout time slot after X orders lets you give a number for maximum appointments that can be fixed in that particular time slot. Once the threshold is reached, it will lock the time slot so it is unavailable for further bookings.

The Price for the time slot field will let you add different prices for each time slot. I have already entered the price in the product settings and hence I left this field empty to avoid multiple calculations. You just have to set the From time & To time for each time slot and you are done.

The checkbox “Make unavailable for other products once lockout is reached” is left unchecked. It is used for cases where we have a single person providing multiple services. We will explore that in a different blog post.

Prevent booking on certain dates with WooCommerce - Creating Time Slots
Creating Time Slots

Once you have added your time slots, you will need to click on the “Update” button.

All your time slots will be displayed in the Manage Dates, Time Slots tab. In our case, a total of 14 time slots were created.

Prevent booking on certain dates with WooCommerce - Time slots for Specific Dates
Time slots for Specific Dates

The next thing you want to do is block the dates. For that, go to Booking Meta Box-> Settings and then in the third field you can add the dates that you want to block for booking.

Prevent booking on certain dates with WooCommerce - Adding dates to be blocked
Adding dates to be blocked

In case you want to block certain dates for all your products, you can do that globally by going to Bookings-> Settings and you will see the field for blocking days. You just have to select the dates from the calendar and save the changes.

Prevent booking on certain dates with WooCommerce - Global Settings for blocking dates
Global Settings for blocking dates

Since this is a “Simple Product”, there aren’t any specific settings under the product data section. You just have to enter the basic details like the Regular price and Sale price. This will be used for all time slots.

Prevent booking on certain dates with WooCommerce - Product Settings
Product Settings

Finally, the field names that appear on the frontend can be changed. Go to Bookings -> Settings -> Booking Labels and change the names. Once you are done, save the changes.

Prevent booking on certain dates with WooCommerce - Booking Labels
Booking Labels

 

Blocking Dates with WooCommerce Booking & Appointment Plugin: User Experience

Once the above setup is created, the product page on frontend looks like below:

Prevent booking on certain dates with WooCommerce - Frontend
Frontend

When you click on the calendar icon, it shows a monthly view and all the dates that were added in the blocked section are seen lighter than the rest and the user won’t be able to select those dates indeed serving the purpose.

Prevent booking on certain dates with WooCommerce - Blocked Dates in the calendar
Blocked Dates in the calendar

Conclusion:

Blocking dates is really important because there are days when the service won’t be available and an appointment system should be capable of that. It could be days like Christmas, New Year or any particular date. WooCommerce Booking And Appointment Plugin provides a complete solution for a bookable product.

This setup is exactly similar to creating time slots with recurring weekdays. The only difference is that we added blocked dates or holidays in this one. If you are a beginner it will take you 15 minutes to get this up.

Browse more in: Documentation, How Tos, Tutorials, WooCommerce, WooCommerce Booking & Appointment, WordPress

Share It:

Subscribe
Notify of
0 Comments
Newest
Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x