I have a fairly simple setup, but I have a problem with the “No Preference” option causing double bookings. Config
1 Location
7 Services (but was able to duplicate using only one service 1hour long)
5 Providers
I book an appointment at 10:00 (1st provider is selected)
I book a second appointment at 10:15 (2nd provider is selected)
I book a third appointment at 10:30 (3rd provider is selected)
I book a fourth appointment at 10:00 (2nd provider is selected again overlapping the 10:15).
Second scenario (easier)
I book an appointment at 10:00 (1st provider is selected)
I book a second appointment at 10:30 (2rd provider is selected)
I book a third appointment at 10:00 (2nd provider is selected again overlapping the 10:30).
This appears to be related to the No Preference JS, not the backend. I added this as a fix for now:
add_filter('birchschedule_view_bookingform_validate_appointment_info', function($errors){
global $birchschedule;
$time_errors = $birchschedule->view->bookingform->validate_booking_time();
return array_merge($errors, $time_errors);
}, 20);
This causes the back end to catch the double book and send back a “Time is unavailable” error, which is better than the double booking.
Thanks,
Doug