Thanks it worked! 🙂
Regarding 2. – Yeah I don’t want any pagination, is that possible?
Custom Functions or functions.php:
add_filter( 'app_js_data', 'app_js_data' );
function app_js_data( $data ) {
$data['page_length'] = 1000;
return $data;
}
Display Settings > Advanced > Additional css Rules (Front end):
.app-list-wrapper .dataTables_length {
display: none;
}
Awesome – thanks, it worked!
One last additional question:
Is it possible to change the service availability (set holidays so the service should be unavailable) by clicking on a toggle button?
Example: When the status is “Closed,” the service should be unavailable, and all upcoming bookings should be canceled. On the other hand, when the status is “Open,” the service should be available.
I have tried it with the following function but sadly no success:
Note: The service has ID 1
add_filter('wp_base_booking_validate_reservation', function($valid, $service_id) {
$status = get_option('header_html_1', 'Open');
// Define the services that should be blocked when closed
$blocked_services = [1]; // Replace with your actual service IDs
if ($status === 'Closed' && in_array($service_id, $blocked_services)) {
return false; // Block only specific services
}
return $valid;
}, 10, 2);
We don’t have a “wp_base_booking_validate_reservation” filter hook. So that function cannot possibly work.
You can use the integrated Limited Availability addon:
– When enabled, service is only available at the selected days in its full calendar. If you select no dates, service is always unavailable
– When disabled, service is available according to its working hours
Cheers,
Hakan
Can it be triggered via functions? If yes, how is the filter hook called?
Service availability affects front end calendar generation. So, it starts from the beginning of everything. What you are asking doesn’t make sense.
What are you trying to do?
The service should be set to “Holiday” for X days/weeks/months as soon as I click the button and removed when I click it again.
So you want to limit bookings that user can book within a predefined time interval dynamically?
If not dynamically, you can use the integrated Quotas addon. For example one booking per week per logged in user. User must be logged in which you can achieve by setting Logged in Required setting as “Yes”.
But if you want it dynamically and for X days, that can only be done at the front end with Javascript and it can only be done with serious custom coding which will not be free.
If you are interested, please contact us using the Contact Form on our website. In your message please provide a link to your booking page because that will depend on the booking view you are using.
Cheers,
Hakan
Thanks for your help, I will contact you (again) in case I need further help.