Modify booking fields

Booking Filters

To customize the booking fields you can use WordPress actions and filters.

The booking fields in WP Hotelier are divided in two parts:  Address Fields and Additional Information Fields. Each of those group of fields have a custom filter, so you can use that filter to add/remove/modify a field from each group.

The name of the filters are  hotelier_booking_default_address_fields for the Address Fields and  hotelier_booking_additional_information_fields for the Additional Information Fields.

You can view the arrays of each group in   hotelier/includes/class-htl-booking.php (source code).

How it works? Change a field to required

For example, to make the "Postcode/Zip" required, you just need to create a function in  functions.php (of your child theme) and change its "required" property to true.

function custom_required_field( $fields ) {
    $fields['postcode']['required'] = true;
    return $fields; 
add_filter( 'hotelier_booking_default_address_fields', 'custom_required_field' );