Change The Booking Form Strings

, ,

WooCommerce Bookings shows a form to book the product on its single page. The form includes a calendar and it may include other fields like persons and resources, based on the product configuration.

Also, always based on the product configuration, the form will show different strings to the user to communicate the product availability or other things.

How do you change these form strings? They are not always right, your product may require a different string.

As always, there’s a snippet!

Hands On The Code!

Open the functions.php file in wp-content/themes/your-child-theme-name/ and add this code at the end of it:

add_filter( 'booking_form_params', 'change_booking_form_params' );
function change_booking_form_params( $params ) {
$params['i18n_date_unavailable' = 'This date is unavailable';
$params['i18n_date_fully_booked'] = 'This date is fully booked and unavailable';
$params['i18n_date_partially_booked'] = 'This date is partially booked – but bookings still remain';
$params['i18n_date_available'] = 'This date is available';
$params['i18n_start_date'] = 'Choose a Start Date';
$params['i18n_end_date'] = 'Choose an End Date';
$params['i18n_dates'] = 'Dates';
$params['i18n_choose_options'] = 'Please select the options for your booking above first';
return $params;

view raw


hosted with ❤ by GitHub

This code already includes all the default form strings used by WooCommerce Bookings. You can change any of them, and remove the ones that you don’t want to change, by deleting the entire line.

You can also actually leave them in the file, but I suggest not to, especially if your site language is not English. Leaving them there in English will cause localization issues since WooCommerce Bookings will not find those form strings for localization.

2 replies
  1. rob
    rob says:

    Hi! Do have a snippet to hide the price total on the booking form? I use the extra product options plugin that calculates the total price based on options, and I need to remove the price shown by the bookings plugin (which in my case shows 0).


Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply