How to show past bookings in usual calendar?

First of all, Booking Calendar can not show past months, because it’s does not possible to create bookings in past.
You can show past bookings in Timeline view, like in this demo.

But if by some reason, you need to show bookings in usual inline month view calendar, so then you will be need to make this fix.

Please make backup of your Booking Calendar folder at the ../wp-content/plugins/ for ability to restore it, if you will make some mistake, or just need original Booking Calendar version.

Important! Please note, its hack/trick customization. Its will not be supported in future updates. So you will need to make this customization each time after upfdate of plugin. If something is not work, please recheck this instruction once again. Its was test in Booking Calendar update 8.3.2 and working well.

Disclaimer. Unfortunately we can not start, right now, some personal customization or custom development, because almost have no free time.
Check more about new features here https://wpbookingcalendar.com/faq/need-new-feature/
Thank you for understanding.
Please note, if you will modify the source code of the Booking Calendar, we will not guaranteed the correct work of plugin and do not support it.

So let start.

1) Please open this file ../wp-content/plugins/{Booking Calendar Folder}/core/lib/wpdev-booking-class.php

( you can check how to edit files in WordPress menu in this article https://wpbookingcalendar.com/faq/how-edit-file-in-wp-menu/ )

then find this code:

        if ($approved == 'admin_blank') {

            $sql_req = "SELECT DISTINCT dt.booking_date

                     FROM {$wpdb->prefix}bookingdates as dt

                     INNER JOIN {$wpdb->prefix}booking as bk

                     ON    bk.booking_id = dt.booking_id

                     WHERE  dt.booking_date >= CURDATE() {$trash_bookings} AND bk.booking_type IN ($bk_type_additional) AND bk.form like '%admin@blank.com%'

                     ORDER BY dt.booking_date" ;
            $dates_approve = $wpdb->get_results(  $sql_req  );
            
        } else {
            
            if ($approved == 'all')
                $sql_req = apply_bk_filter('get_bk_dates_sql', "SELECT DISTINCT dt.booking_date

                     FROM {$wpdb->prefix}bookingdates as dt

                     INNER JOIN {$wpdb->prefix}booking as bk

                     ON    bk.booking_id = dt.booking_id

                     WHERE  dt.booking_date >= CURDATE() {$trash_bookings} AND bk.booking_type IN ($bk_type_additional)
                         
                     ". (($skip_booking_id != '') ? " AND dt.booking_id NOT IN ( ".$skip_booking_id." ) ":"") ."
                         
                     ORDER BY dt.booking_date", $bk_type_additional, 'all' , $skip_booking_id);

            else
                $sql_req = apply_bk_filter('get_bk_dates_sql', "SELECT DISTINCT dt.booking_date

                     FROM {$wpdb->prefix}bookingdates as dt

                     INNER JOIN {$wpdb->prefix}booking as bk

                     ON    bk.booking_id = dt.booking_id

                     WHERE  dt.approved = $approved AND dt.booking_date >= CURDATE() {$trash_bookings} AND bk.booking_type IN ($bk_type_additional)
                         
                     ". (($skip_booking_id != '') ? " AND dt.booking_id NOT IN ( ".$skip_booking_id." ) ":"") ."

                     ORDER BY dt.booking_date", $bk_type_additional, $approved, $skip_booking_id );
//$sql_req = str_replace( 'dt.booking_date >= CURDATE()  AND', '' , $sql_req);	//Show past bookings,  as well
            $dates_approve = apply_bk_filter('get_bk_dates', $wpdb->get_results( $sql_req ), $approved, 0,$bk_type );
        }

and replace it to this code:

        if ($approved == 'admin_blank') {

            $sql_req = "SELECT DISTINCT dt.booking_date

                     FROM {$wpdb->prefix}bookingdates as dt

                     INNER JOIN {$wpdb->prefix}booking as bk

                     ON    bk.booking_id = dt.booking_id

                     WHERE  1=1 {$trash_bookings} AND bk.booking_type IN ($bk_type_additional) AND bk.form like '%admin@blank.com%'

                     ORDER BY dt.booking_date" ;
            $dates_approve = $wpdb->get_results(  $sql_req  );
            
        } else {
            
            if ($approved == 'all')
                $sql_req = apply_bk_filter('get_bk_dates_sql', "SELECT DISTINCT dt.booking_date

                     FROM {$wpdb->prefix}bookingdates as dt

                     INNER JOIN {$wpdb->prefix}booking as bk

                     ON    bk.booking_id = dt.booking_id

                     WHERE  1=1 {$trash_bookings} AND bk.booking_type IN ($bk_type_additional)
                         
                     ". (($skip_booking_id != '') ? " AND dt.booking_id NOT IN ( ".$skip_booking_id." ) ":"") ."
                         
                     ORDER BY dt.booking_date", $bk_type_additional, 'all' , $skip_booking_id);

            else
                $sql_req = apply_bk_filter('get_bk_dates_sql', "SELECT DISTINCT dt.booking_date

                     FROM {$wpdb->prefix}bookingdates as dt

                     INNER JOIN {$wpdb->prefix}booking as bk

                     ON    bk.booking_id = dt.booking_id

                     WHERE  dt.approved = $approved AND 1=1 {$trash_bookings} AND bk.booking_type IN ($bk_type_additional)
                         
                     ". (($skip_booking_id != '') ? " AND dt.booking_id NOT IN ( ".$skip_booking_id." ) ":"") ."

                     ORDER BY dt.booking_date", $bk_type_additional, $approved, $skip_booking_id );
//$sql_req = str_replace( 'dt.booking_date >= CURDATE()  AND', '' , $sql_req);	//Show past bookings,  as well
            $dates_approve = apply_bk_filter('get_bk_dates', $wpdb->get_results( $sql_req ), $approved, 0,$bk_type );
        }

2) Please open this file ../wp-content/plugins/{Booking Calendar Folder}/js/client.js

( you can check how to edit files in WordPress menu in this article https://wpbookingcalendar.com/faq/how-edit-file-in-wp-menu/ )

then find this code:

var bkMinDate = 0;

and replace it to this code:

var bkMinDate = null;

3)
then find this code:

if (is_this_admin == false) {

and replace it to this code:

if  ( (false) && (is_this_admin == false) ) {

4) Please open this file ../wp-content/plugins/{Booking Calendar Folder}/js/wpbc_times.js

( you can check how to edit files in WordPress menu in this article https://wpbookingcalendar.com/faq/how-edit-file-in-wp-menu/ )

then find this code:

function isTimeTodayGone( myTime, sort_date_array ){

and replace it to this code:

function isTimeTodayGone( myTime, sort_date_array ){
   return false;

5) If you are using paid version of Booking Calendar, then
Please open this file ../wp-content/plugins/{Booking Calendar Folder}/inc/_ps/personal.php

( you can check how to edit files in WordPress menu in this article https://wpbookingcalendar.com/faq/how-edit-file-in-wp-menu/ )

then find this code:

        if ($approved == 'all')
              $sql_req =   "SELECT DISTINCT dt.booking_date

                 FROM {$wpdb->prefix}bookingdates as dt

                 INNER JOIN {$wpdb->prefix}booking as bk

                 ON    bk.booking_id = dt.booking_id

                 WHERE  dt.booking_date >= CURDATE() {$trash_bookings} AND bk.booking_type  IN ($bk_type) ".$skip_bookings."

                 ORDER BY dt.booking_date";

        else
             $sql_req = "SELECT DISTINCT dt.booking_date

                 FROM {$wpdb->prefix}bookingdates as dt

                 INNER JOIN {$wpdb->prefix}booking as bk

                 ON    bk.booking_id = dt.booking_id

                 WHERE  dt.approved = $approved AND dt.booking_date >= CURDATE() {$trash_bookings} AND bk.booking_type IN ($bk_type) ".$skip_bookings."

                 ORDER BY dt.booking_date" ;

and replace it to this code:

        if ($approved == 'all')
              $sql_req =   "SELECT DISTINCT dt.booking_date

                 FROM {$wpdb->prefix}bookingdates as dt

                 INNER JOIN {$wpdb->prefix}booking as bk

                 ON    bk.booking_id = dt.booking_id

                 WHERE  1=1 {$trash_bookings} AND bk.booking_type  IN ($bk_type) ".$skip_bookings."

                 ORDER BY dt.booking_date";

        else
             $sql_req = "SELECT DISTINCT dt.booking_date

                 FROM {$wpdb->prefix}bookingdates as dt

                 INNER JOIN {$wpdb->prefix}booking as bk

                 ON    bk.booking_id = dt.booking_id

                 WHERE  dt.approved = $approved AND 1=1 {$trash_bookings} AND bk.booking_type IN ($bk_type) ".$skip_bookings."

                 ORDER BY dt.booking_date" ;

6) If you are using Booking Calendar Business Large or higher version then, Please open this file ../wp-content/plugins/{Booking Calendar Folder}/inc/_bl/biz_l.php

( you can check how to edit files in WordPress menu in this article https://wpbookingcalendar.com/faq/how-edit-file-in-wp-menu/ )

then find this code:

WHERE ".$my_approve_rule." dt.booking_date >= CURDATE() {$trash_bookings} AND

and replace it to this code:

WHERE ".$my_approve_rule." 1=1 {$trash_bookings} AND

Test it.
Please do not forget to clear browser cache before testing these changes.

Is there any API or hooks for using with Booking Calendar ?

1) Currently there is no full API for using Booking Calendar plugin with other plugins or services.
Some hooks exist, but they does not documented well, yet. We are in process of improving this with future updates of plugin.

2) But still plugin have some useful functions and hooks for such purpose.
Please check this file ../{Booking Calendar Folder}/core/wpbc-dev-api.php
Here you can find some useful functions and hooks.

Integration own payment gateway into Booking Calendar update 7.0 or newer

In new update 7.0 (or newer) exist new solid way of integration of your custom gateways.

This instruction is explain how to start work with integration your payment gateway into Booking Calendar Business Small or higher versions of update 7.0 or newer, based on exist payment gateway.

Let say that your new payment gateway have name: loc_payment.

1) You need to create new folder, like this:

../{Booking Calendar Folder}/inc/gateways/loc_payment/

then create new PHP file with following name:

../{Booking Calendar Folder}/inc/gateways/loc_payment/wpbc-gw-loc_payment.php

2) After this you can copy paste code from file

../{Booking Calendar Folder}/inc/gateways/stripe/wpbc-gw-stripe.php
(or some other, which you better like)
into your new file, and replace in content terms like "stripe" or "STRIPE" to "loc_payment" or "LOC_PAYMENT" accordingly.

3) Then check your code relative comments in this new file and configure your payment form and settings, relative to API and help info from website of your new payment gateway.

4) Additionally you need to add one new hook for ability to load the new payment gateway

// General API for Adding new gateways:
function add_my_gateway( $gateway ){ return $gateway . ',gateway_ID'; }
add_filter( 'wpbc_gateways_original_id_list', 'add_my_gateway' );

In your case you need to have something like this:

function add_my_loc_payment( $gateway ){ return $gateway . ',loc_payment'; }
add_filter( 'wpbc_gateways_original_id_list', 'add_my_loc_payment' );

5) If your payment gateway have response functionality, so then you can check this file

../{Booking Calendar Folder}/inc/gateways/stripe/stripe-charge.php
and create similar file in your payment gateway folder.

How to open booking form in popup (modal window) ?

You can use the code like this for opening your booking form in popup (modal window):

<a href="javascript:void(0)" onclick="javascript:jQuery('.bookingFormModal').modal('show');" class="btn button">Booking form in popup window</a> <div class="wpdevelop">
	<div class="modal bookingFormModal" tabindex="-1" role="dialog" style="display:none;z-index:9999999;">
		<div class="modal-dialog modal-lg" role="document">
			<div class="modal-content">
			  <div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button><h4 class="modal-title">Booking Form</h4></div>
			  <div class="modal-body"> [booking type=1]</div>
			</div>
		</div>
	</div>
</div>
<style type="text/css"> .wpdevelop .modal { overflow-y: scroll; } </style>

where [booking type=1] - shortcode for your booking form.
Probably additionally you will be need to customize some CSS classes and CSS styles relative to your actual theme.


In old versions of Booking Calendar (prior update 7.0 ) please use this code:

<a class="btn button">Booking form in popup window</a>
<div class="wpdevbk">
	<div class="modal bookingFormModal" style="display: none; width: 700px !important; height: 1000px !important;">
		<div class="modal-header">
			<a class="close" data-dismiss="modal">& #10006;</a>
			<h3 style="margin-top: -27px;">Booking Form</h3>
		</div>
		<div class="modal-body">[booking type=4 nummonths=2]</div>
	</div>
</div>

where [booking type=4 nummonths=2] - shortcode for your booking form.
Probably additionally you will be need to customize some CSS classes and CSS styles relative to your actual theme.

How to edit file from WordPress menu

WordPress update 4.9 or newer.

Since update 4.9 of WordPress, its was updated interface of editing plugin files via WordPress admin panel.
1) Now, you can open WordPress admin panel, then
2) Open WordPress > Plugins > Editor menu
3) In the top right side for option "Select plugin to edit" select "Booking Calendar" plugin (please note, if you have several versions of Booking Calendar (for example, Booking Calendar Free version as deactivated version and paid version, so you will see both options there, and you need to select correct, activated version of your version of Booking Calendar) and click "Select" button
4) Now at right side you can see files and folders of plugin, you can select specific file to edit and make your customization,
after this click on Save changes button.
5) Clear browser cache and test it.

WordPress update 4.8 or older.
1) Open the WordPress Plugins menu page.

2) Click on "Edit" link under the "Booking Calendar" plugin.

3) On the right side of that page, please find specific file, like this:

booking/css/client.css

Or some other that you require. Click on that link.

Please note, if you do not see some specific file in list at the right side, so probably this file in some sub-folder (WordPress Edit plugin menu page do not show links to all files at once).
You will be need to edit URL in your browser and specify directly, what file to edit.

One restriction. (Booking Calendar Free version have name of plugin folder "booking", paid versions of Booking Calendar can have different names. For example Booking Calendar Personal version can have name of folder like this: booking.personal.7.0 (etc). So you will be need to change in URL this folder appropriately.

For example, if you need to edit this file: ../{Booking Calendar Folder}/core/admin/page-email-trash.php
Then you need to edit URL to this:
https://your-server.com/wp-admin/plugin-editor.php?file=booking/core/admin/page-email-trash.php

Important part here this path: ?file=booking/core/admin/page-email-trash.php
And in case, if you use some paid version, you will be need to replace folder name from "booking" to "booking.personal.7.0" or some other.

4) Make edit of this file.

5) Then click on "Update file" button to save changes.

6) Clear browser cache and test it.

How to scroll months in several calendars at the same page ?

Its possible to make a trick for scrolling months in several calendars at the same page by clicking on "external links".
Its means that you will have 2 external links (do not inside of calendars for scrolling months forward or backward).
Example:

<a class="button" onclick="jQuery('div.hasDatepick').each(function( index ) { jQuery.datepick._adjustDate(this, -1, 'M'); });" href="javascript:void(0)">Previous Month in all calendars</a> - <a class="button" onclick="jQuery('div.hasDatepick').each(function( index ) { jQuery.datepick._adjustDate(this, +1, 'M'); });" href="javascript:void(0)">Next Month in all calendars</a></p>
<div class="clear"></div>
<div style="float:left;width:45%;margin-right:5%;">[booking type=3 form_type='standard' nummonths=1]</div>
<div style="float:left;width:45%;margin-right:5%;">[booking type=4 form_type='standard' nummonths=1]</div>
<div class="clear"></div>
<p>
P.S. Please read how manually to configure Booking Calendar shortcodes here.

Showing or hiding additional form fields, depend from selected option in selectbox.

If you need to show or hide some form fields in the booking form, depend from the selected option in some selectbox, you can make it with JavaScript customization.

For example, if you need to show additional fields for entering "First and Last Names" of the each visitor, depend from the selected number of this visitors, then you can have this customization in your booking form at the Booking > Settings > Fields page:

<p>Adults:  [select visitors class:visitors_selection "1" "2" "3" "4"] </p>
<p>First Name (required):<br />[text* name] </p>
<p>Last Name (required):<br />[text* secondname] </p>
<p>Email (required):<br />[email* email] </p>
<div class="visitors_selection_div v_num2 v_num3 v_num4" style="display:none;">
   <p>First Name of 2nd visitor:<br />[text* name_2nd] </p>
   <p>Last Name of 2nd visitor:<br />[text* secondname_2nd] </p>
</div>
<div class="visitors_selection_div v_num3 v_num4" style="display:none;">
   <p>First Name of 3rd visitor:<br />[text* name_3rd] </p>
   <p>Last Name of 3rd visitor:<br />[text* secondname_3rd] </p>
</div>
<div class="visitors_selection_div v_num4" style="display:none;">
   <p>First Name of 4th visitor:<br />[text* name_4th] </p>
   <p>Last Name of 4th visitor:<br />[text* secondname_4th]</p>
</div>
<script type="text/javascript">
   jQuery('.visitors_selection').on('change', function() {
       var visitors_num = jQuery(this).find(":selected").val();
       jQuery('.visitors_selection_div').hide();
       jQuery('.visitors_selection_div.v_num' + visitors_num ).show();
   });
</script>

Description of this code:
We are having 3 additional DIV elemtns, where exist fields shortcodes for entering First and Last names of visitors. All these DIV elements does not visible for the visitors

style="display:none;"
.

We attach JavaScript function for selection of the visitors number:

jQuery('.visitors_selection').on('change', function() {

Then we get the number of selected visitors:
var visitors_num = jQuery(this).find(":selected").val();

Hide by default all our additional DIV elements:
jQuery('.visitors_selection_div').hide();

And show DIV elements, that fit to our number of selected visitors:
jQuery('.visitors_selection_div.v_num' + visitors_num ).show();

The trick here in how we apply CSS CLASSes to the DIV elements structure.

How to open booking form in modal window after clicking on date in calendar ?

This customization will open booking form in modal window, after visitor clicked on date in calendar.
Preparation:
- You need to have only one booking form on one specific visible page. This customization does not support several booking forms on the same page.
- You need to activate "Single day" selection mode at the General Booking Settings page in "Calendar" section
- Your theme or some other plugin require do not use any type of Bootstrap library. Otherwise its can be overwriting, and possible issues.
- If you are using Booking Calendar version update 5.4.3 or older, please make this small customization:
Please open this file ../{Booking Calendar Folder}/js/client.js
then find this code:

if(typeof( selectDayPro ) == 'function') {selectDayPro( date, bk_type);}

and replace it to this code:

if(typeof( selectDayPro ) == 'function') {selectDayPro( date, bk_type);}
jQuery( ".booking_form_div" ).trigger( "date_selected" , [ bk_type, date ] );

Customization:
Please open the Booking > Settings > Fields page, and make customization of your booking form in a way like this:

[calendar] 
<div class="modal bookingFormModal"    
     style="display:none;width: 600px !important;height: 950px !important;">
		<div class="modal-header">
			<a class="close" data-dismiss="modal">& #10006;</a>
			<h3 style="margin-top:-27px;">Booking Form</h3>
	    </div>
	    <div class="modal-body">
			<!-- Content of booking form -->
			<div class="form-hints"> 
				Selected Date and Times: [check_in_date_hint]   [start_time_hint] - [end_time_hint]<br>
				Total cost: [cost_hint]<br/><br/>
			</div>
			<p>Select Times:<br />[select* rangetime multiple "10:00 AM - 12:00 PM@@10:00 - 12:00" "12:00 PM - 02:00 PM@@12:00 - 14:00" "02:00 PM - 04:00 PM@@14:00 - 16:00" "04:00 PM - 06:00 PM@@16:00 - 18:00" "06:00 PM - 08:00 PM@@18:00 - 20:00"]</p> 			
			<p>First Name (required):<br />[text* name] </p> 
			<p>Last Name (required):<br />[text* secondname] </p> 
			<p>Email (required):<br />[email* email] </p> 
			<p>Phone:<br />[text phone] </p> 
			<p>Adults:  [select visitors class:span1 "1" "2" "3" "4"] Children: [select children class:span1 "0" "1" "2" "3"]</p> 
			<p>Details:<br /> [textarea details] </p> 
			<p>[checkbox* term_and_condition use_label_element "I Accept term and conditions"] </p> 
			<p>[captcha]</p> 
			<hr/> 
			<div>
				[submit class:btn "Send"] 
				<a href="javascript:void(0)" style="float: right;margin: 2px 20px;" onclick="javascript:jQuery('.bookingFormModal').modal('hide');" class="btn">Close</a>
			</div> 
			<!-- End Content of booking form -->
	    </div>
</div>
<script type="text/javascript"> 
     jQuery( ".booking_form_div" ).on('date_selected', function(event, bk_type, date) {
           jQuery('.bookingFormModal').modal("show");
     });
</script> 

Update the booking form, and test it at the front-end.

Please note, starting from this line:

<!-- Content of booking form -->

to this line
<!-- End Content of booking form -->

is going on your booking form customization. So you can insert or remove your booking form shortcodes.

This customization, was made for the Booking Calendar Business Medium version, so here is using some shortcodes (like [cost_hint], [check_in_date_hint], [start_time_hint], [end_time_hint], [select rangetime ...]), that can be unavailable in lower versions.

P.S. One additional little fix. Please remove empty space (second symbol) after & in this code "& #10006;" at the booking form. Its will show correctly "x" symbol in the top of modal form.

Configuring different type of days selection for different calendars

This JavaScript is possible to use before the booking shortcode, like this:

[booking type=1 form_type='standard' nummonths=1]
in the edit post or edit page WordPress menu pages. In all examples below we will use that shortcode, but in your examples the parameters of the booking shortcode will be other, of course. Please read more how to insert and configure the booking shortcode into the post or page here.

Important! Please note, you be able to insert the JavaScript if you are logged in as admin user (the subscriber users have not rights to insert the JavaScript into the posts or pages) and turn the edit post content form into the "Text" mode instead of the "Visual" (you can activate this "Text tab" at the top right side of the edit post content form).

This customization is possible for the Business Small or higher versions of update 4.2 or newer.

Please note, for do not have any conflicts, please use this customizations, when you are insert into the post or page only single booking form. Its mean you are not insert the other booking shortcode into this page and do not have any booking widgets at this page.


Activating Single day selection mode.
Please use this code, for activating that type of days selection for the current booking form, if by default you are using the other type of days selections at the General Booking Settings page:

<script type="text/javascript">
   bk_days_selection_mode = 'single';
</script>
[booking type=1 form_type='standard' nummonths=1]


Activating Multiple days selection mode.
Please use this code, for activating that type of days selection for the current booking form, if by default you are using the other type of days selections at the General Booking Settings page:

<script type="text/javascript">
   bk_days_selection_mode = 'multiple';
</script>
[booking type=1 form_type='standard' nummonths=1]


Activating Range days selection as a FIXED number of days with 1 mouse click.
Please use this code, for activating that type of days selection for the current booking form, if by default you are using the other type of days selections at the General Booking Settings page:

<script type="text/javascript">
   bk_days_selection_mode    = 'fixed';
   bk_1click_mode_days_num   = 7;    // Number of days selection with 1 mouse click
   bk_1click_mode_days_start = [-1]; // { -1 - Any | 0 - Su,  1 - Mo,  2 - Tu, 3 - We, 4 - Th, 5 - Fr, 6 - Sat }
</script>
[booking type=1 form_type='standard' nummonths=1]

In this example we are used 2 new variables: bk_1click_mode_days_num and bk_1click_mode_days_start.

bk_1click_mode_days_num - its number of days selection with 1 mouse click. You can assign number of days selections to this variable. For example for having 5 days selections, please use this code:

bk_1click_mode_days_num   = 5;

bk_1click_mode_days_start - its array, where we can specify the start day of the range days selection.
If we are need to set the start day of range selection as any day of week, please use this code:

bk_1click_mode_days_start   = [-1];

If we are need to set the specific start day of week selections or multiple days of week as start day for the range selections, please assign these values:
0 - Sunday,
1 - Monday,
2 - Tuesday,
3 - Wednesday,
4 - Thursday,
5 - Friday,
6 - Saturday.
So if you are need to set the start day of range selection as Saturday, please use this code:
bk_1click_mode_days_start   = [6];

If you are need to set the start day of range selections as Monday and Friday, please use this code:
bk_1click_mode_days_start   = [1,5];

This code

bk_1click_mode_days_start   = [-1];

and this code:
bk_1click_mode_days_start   = [0,1,2,3,4,5,6];

is equivalent.


Activating Range days selection as a DYNAMIC range of days with 2 mouse clicks.
Please use this code, for activating that type of days selection for the current booking form, if by default you are using the other type of days selections at the General Booking Settings page:

<script type="text/javascript">
   bk_days_selection_mode    = 'dynamic';
   bk_2clicks_mode_days_min       = 1;    // Min. Number of days selection with 2 mouse clicks
   bk_2clicks_mode_days_max       = 10;   // Max. Number of days selection with 2 mouse clicks
   bk_2clicks_mode_days_specific  = [];   // Example [5,7]
   bk_2clicks_mode_days_start     = [-1]; // { -1 - Any | 0 - Su,  1 - Mo,  2 - Tu, 3 - We, 4 - Th, 5 - Fr, 6 - Sat }
</script>
[booking type=1 form_type='standard' nummonths=1]

In this example we are used 4 new variables: bk_2clicks_mode_days_min, bk_2clicks_mode_days_max, bk_2clicks_mode_days_specific and bk_2clicks_mode_days_start.

bk_2clicks_mode_days_min - Minimum number of days selection with 2 mouse clicks. You can assign number of days selections to this variable. For example for having minimum 7 days selections, please use this code:

bk_2clicks_mode_days_min   = 7;

bk_2clicks_mode_days_max - Maximum number of days selection with 2 mouse clicks. You can assign specific number of days selections to this variable. For example for having maximum 14 days selections, please use this code:

bk_2clicks_mode_days_max   = 14;

bk_2clicks_mode_days_specific - its array, where we can specify that is possible to select only specific number of days selection.
For having possibility to select any number of days, please use this code:

bk_2clicks_mode_days_specific   = [];

For having possibility to select only weeks - 7 days, 14 days, 21 days... please use this code:
bk_2clicks_mode_days_specific = [7];

For having possibility to select only - 5, 7, 10, 14, 20, 21 days... please use this code:
bk_2clicks_mode_days_specific = [5,7];

bk_2clicks_mode_days_start - its array, where we can specify the start day of the range days selection.
If we are need to set the start day of range selection as any day of week, please use this code:

bk_2clicks_mode_days_start   = [-1];

If we are need to set the specific start day of week selections or multiple days of week as start day for the range selections, please assign these values:
0 - Sunday,
1 - Monday,
2 - Tuesday,
3 - Wednesday,
4 - Thursday,
5 - Friday,
6 - Saturday.
So if you are need to set the start day of range selection as Saturday, please use this code:
bk_2clicks_mode_days_start   = [6];

If you are need to set the start day of range selections as Monday and Friday, please use this code:
bk_2clicks_mode_days_start   = [1,5];

This code

bk_2clicks_mode_days_start   = [-1];

and this code:
bk_2clicks_mode_days_start   = [0,1,2,3,4,5,6];

is equivalent.

How to add the functionality of various attributes or tags to the search form ?

In the search availability form possible to use additional parameters for searching. For example searching by specific location or some other attributes.

How to configure it?

"Custom fields".
You can use the "custom fields" in the posts or pages, were you inserted shortcode for booking form.

One general rule for the "custom fields" - each custom field must start from "booking_" term.

For example, if you wan to search by City, then you need to make this configuration:

1) In the search form (at the Booking > Settings > Search page), you can use this selectbox configuration:

<label>City:</label>
<select id="booking_city" name="booking_city">
   <option value="">Any</option>
   <option value="Salernes">Salernes</option>
   <option value="Barjols">Barjols</option>
   <option value="Lorgues">Lorgues</option>
</select>

2) Then at the post or page, where you inserted booking form, you need to add new "custom field" with name "booking_city" and value (for example): "Lorgues".

In the same way you can add new additional parameter(s).
For example:

<label>Pool:</label>
<select id="booking_pool" name="booking_pool">
 <option value="">Any</option>
 <option value="1">Yes</option>
 <option value="0">No</option>
</select>

And of course in the page or post you need to create custom field: "booking_pool" with value "1" or "0"

General rules.

If you are having additional parameters, like this
- property_ab (this is some parameter)
- property_ac (number of beds)
- property_ad (square meters)
- ... etc...

you need to have parameters in format, where names of the custom fields starts from "booking_" terms:

- booking_property_ab (this is some parameter)
- booking_property_ac (number of beds)
- booking_property_ad (square meters)

Then inside of the search form you can have this selections:

    Number of beds:
    <select id="booking_property_ac" name="booking_property_ac">
    <option value="1">1</option>
    <option value="2">2</option>
    </select>

And for the posts or pages you can use custom fields with names "booking_property_XX", where XX = {ab | ac | ad}.

Tags
You can use "tags" in the posts or pages, where you are inserted the booking form for the specific booking resource.
In the search form you are need to use this keyword:

[search_tag] - search inside of posts/pages, which are have this tag.

Please note, its text field, so your visitors need manually to enter the tag for the searching.

Trick
Its also possible to customize this element as selectbox instead of the text field. You will be need to replace the [search_tag] shortcode to this HTML element:

<select id="booking_search_tag" name="tag">
<option value="">Any</option>
<option value="room">Room</option>
<option value="apartment">Apartment</option>
</select>

where "<option value="room">Room</option>" - list of options to select; "room" its value of the tag, and "Room" - its label, which is showing for the visitors....

Please click at the "Reset cache" button at the bottom of the Booking > Settings > Search page, after you are finish configuration, before making tests at the client side. You can check this troubleshooting instruction, if you do not see search results: https://wpbookingcalendar.com/faq/no-search-results/