So, are you looking forward to setting an Offset while booking with WP Travel?

An offset for booking is a feature that allows users to set a date restriction before a booking can be confirmed.

It enables users to define a specific period or duration that must elapse before the booking can be made.

For example, consider today’s date as April 22, 2024, and the offset for booking is set to 2 days. It means that users cannot book any service less than 48 hours in advance.

This feature is useful when the service provider requires advance notice or preparation time before accepting bookings.

Learn more: How To Add Exclude Dates For All The Trips?

Steps to Set an Offset while Booking with WP Travel

Step 1: Add code in the functions.php file

To set an offset for booking with WP Travel, please add the following code in the functions.php file of your child theme or simply you can add it through code snippets.

function wp_travel_booking_offset() {
    return 2; // Set the booking offset value in days
}
add_filter('wp_travel_booking_offset', 'wp_travel_booking_offset');

Step 2: Check Knowledgebase if you want to create child theme

If you need more information on creating a child theme, please check out our knowledge base.

Starting from today’s date, which is April 22, 2024, users can only select the calendar date starting from April 24th to book a service.

If you want to learn more about the filter hook available in the WP Travel plugin, you can refer to the hook page.