HBook WordPress plugin documentation

If you have any questions that are beyond the scope of this documentation, please feel free to email us via the contact page here.

Plugin installation

There are 2 ways to install a WordPress plugin:

  1. using the WordPress installer
  2. uploading the plugin via FTP

1. Using the WordPress installer

  1. Go to Plugins > Add new
  2. Click Upload
  3. Select the hbook.zip file
  4. Click Install now
  5. Once the plugin has been installed click Activate Plugin

2. Uploading the plugin via FTP

  1. Upload the hbook folder into the wp-content/plugins/ folder on your server
  2. Once the plugin is uploaded log into WordPress and go to Plugins
  3. Find the HBook plugin and click Activate Plugin

Plugin updates

In order to add new functionalities, to stay up to date with the WordPress software evolution, to correct bugs, HBook plugin is regularly updated.

Updating does not affect the content of your site. All the settings and data associated with the plugin will stay the same.

There are 2 ways to update the plugin:

Whatever method you choose, you should backup your website. Is is not compulsory but backing up periodically your entire installation (entire directory structure + database) is a good idea, especially before making any update to themes, plugins, core files, etc. Learn more about backups here.

Automatic update

When a new version of HBook is released you will see a notification on the plugins page and you will be able to update in one click thanks to the Update now action.

FTP update

  1. Go on the Downloads page of CodeCanyon and download the plugin again (when you download the plugin you always get the latest version available)
  2. Unzip the plugin (you need to get an unzipped hbook folder that can be uploaded on your server later on)
  3. Go on the plugin page and deactivate HBook plugin
  4. On your server delete the hbook folder which is located in wp-content/plugins (note that this will not delete the HBook settings since they are stored in your WordPress installation).
  5. Upload the hbook folder you have just unzipped into the wp-content/plugins/ folder
  6. Go on the plugin page and activate HBook plugin

Notifications of an update release via CodeCanyon

If you want to be notified by email when a new version of HBook is released you can check the box Get notified by email if this item is updated on your Downloads page on CodeCanyon.

Accommodation

In this section of the documentation, you will find information regarding the Accommodation menu.

For the plugin to work correctly you need to create at least 1 type of accommodation.


Pricing settings

In this section of the documentation, the following sub-menus from HBook settings are explained:

  1. Seasons
  2. Booking rules
  3. Rates
  4. Extra services
  5. Fees


1. Seasons

For the plugin to work correctly you need to create at least 1 season. Note that since all bookable days must belong to one season, you need to define at least one season with an end date which is at least equal to the Maximum date for a reservation (which can be set in HBook Setting > Misc).



Examples:

  1. Summer and off-peak:
  2. Weekday and Week-end:
  3. School holidays and rest of the year:


2. Booking rules

Booking rules are optionals. There are 5 types of Booking rules.

  1. Check-in days: define on which days customers are allowed to check-in.
  2. Check-out days: define on which days customers are allowed to check-out.
  3. Minimum stays: define the mimimum length of a stay.
  4. Maximum stays: define the maximum length of a stay.
  5. Advanced booking rules: define advanced rules to create compulsory settings for stays, special rates, or discounts.


Allowed check-in and check-out days - Changeover days

With the Allowed check-in days and Allowed check-out days, you can indicate on which days your customers can arrive and leave. It can be set according to season and accommodation.

Examples:

  1. Changeover day on Saturday all year round for all accommodation types:
  2. Different check-in and check-out days depending on seasons:


Minimum amd maximum stay

With the Minimum stay and Maximum stay, you can indicate the minimum number of nights and the maximum number of nights allowed. It can be set according to season and accommodation.

Examples:

  1. Different minimum stays depending on the season (7 nights minimum stay on "Summer" season and 2 nights the rest of the year):
  2. Minimum stay depending on accommodation type and season:
  3. Maximum stay for all accommodation types and seasons:


Advanced booking rules

This is a powerful feature that will enable you to define settings conditionally. It has two different aims.

There are 4 types of advanced rules:

  1. Compulsory: if the booking request has a check-in day that falls in one of the check-in days set in the rule then the booking request must comply with the rule.
  2. Special rate: if the booking request follows the rule a special rate is applied. You will indicate the rate for that rule in Rates page
  3. Compulsory and special rate: this rule is both a compulsory rule and a special rate rule.
  4. Discount: if the booking request follows the rule then a discount is applied. You will indicate the type of discount (percentage or fixed amount) and its value in Rates

Examples:

  1. Week, Week-end and Midweek stay with special rates:
  2. Fixed length stay on a certain season with special rate (Compulsory check-out on following Friday if check-in on Monday):
  3. Discounts for more than 10-night stays and for more than 30-night stays:


3. Rates

Once you have created Accommodation type and Seasons you will be able to define rates.
Below is an example of a rate table for an user who has defined 2 types of accommodationn and 3 seasons.


If you have set a different number of person for the normal occupancy and the maximum occupancy you can add rates for extra people in the Price per adult above normal occupancy table and the Price per child above normal occupancy table.
See example below.


If you have created Special rate rules you will need to define these rates by selecting the name of the rule in the rate tables.
See example below.


If you have created Discount rules you will need to define these rates by creating a new discount rate and selecting the discount rule in the rate table.
See example below.


4. Extra services

If you wish to offer your customer extra services that they can add to their booking, you will be able to set them in this page. An extra service can be a single option or can be a multiple options to pick from. There are different types of extra services that will lead to different price calculation:



5. Fees

Click Fees


If you need to set fees that will come on top of the booking, you will be able to set them in this page. There are different types of fees that will lead to different price calculation:


To create a fee:

  1. click on Add new fee
  2. Enter the name of the fee
  3. Select the type of fee
  4. Enter the amount
  5. Select the accommodation type that are concerned by the fee
  6. click Save


Below are examples of fees and their settings:

Payment settings

In this section of the documentation, you will find information regarding the Payment sub-menus of Hbook menu.



Other settings

In this section of the documentation, you will find information regarding the Emails, Appearance and Misc ( Confirmation settings, Custom CSS, form styles, uninstalling option...) sub-menus of Hbook settings.

1. Emails settings

2. Appearance

In the sub-menu Appearance of Hbook menu, you can do the followings:

3. Miscellaneous

In the sub-menu Misc of Hbook, you can do the followings:

4. Licence

In this sub-menu you will enter your Purchase Code to register your HBook licence.

You may use one Regular Licence for one staging site and one live site.

Forms customization

In this section of the documentation, you will find information regarding the Forms sub-menu of Hbook menu.

Thanks to the Forms page you can customize the forms which are displayed when a customer makes a reservation. This page is divided 3 sections:

  1. Search form: in this section you can customize the fields of the Search form.
  2. Accommodation selection: in this section you can customize the accommodation selection step.
  3. Booking form: in this section you customize the fields of the form customers used for entering their details.


1. Search form

Customize the fields of the Search form.


2. Accommodation selection

Customize the Accommodation selection. Note that the accommodation title, the accommodation thumbnail and the button link towards the accommodation page are not displayed on accommodations pages or if you have only one type of accommodation.

3. Booking form

Customize the fields of the Booking form.

Text customization and translation

In this section of the documentation, you will find information regarding the Text and Languages sub-menus of Hbook menu.


Front-end: How to modify or/and translate text displayed by the plugin?

The Text page is dedicated at customizing and translating any text displayed by HBook.

Translation files for front-end are included for French, Spanish, Italian and German languages. You will find them in wp-content/plugins/hbook/language-files/ (for example: hbook-fr_FR.txt). To upload the translation, follow the instructions set in "How to import/export language files?".

If you use WPML plugin, Polylang plugin or QtranslateX, the languages will be automatically set in HBook->Text.

If your site language, as set in Settings->General->Site language is different than English(United States), it will appear automatically as well in HBook->Text.

To customize or translate a text string:

  1. Find the text displayed by the plugin. The text is organized by section:
    • Search form text
    • Search form messages
    • Accommodation selection
    • Extra services selection
    • Booking details form text
    • Booking details form messages
    • Summary
    • PayPal payment description
    • Error messages
    • Availability calendar
    • Rates table
    • Accommodation list
  2. Change the text. Note that text starting with % is used to display information that are calculated by the plugin (price, number of nights...) so it must not be modified.
  3. Save your modifications.


Back-end: How to translate HBook admin in another language?


Translation files for back-end are included for French, Spanish, Italian and German languages. You will find the .mo and .po in wp-content/plugins/hbook/language-files/ (for example: hbook-admin-fr_FR.po and hbook-admin-fr_FR.po). You just need to copy the .mo and .po file of your language and paste them in hbook/languages, beside hbook-admin.pot.

HBook plugin follows the standards of WordPress internationalization. Below are instructions on how to translate Hbook with Poedit.

  1. Download and install Poedit
  2. Open the hbook/languages/hbook-admin.pot file in Poedit
  3. Create your .po and .mo files by going to File -> Save as...: choose the wp-content/plugins/hbook/languages/ folder and give the file hbook-admin- followed by your locale. For example if you want to translate the plugin in French the file must be named hbook-admin-fr_FR.po . The .mo file will be created automatically on translation.
  4. Translate the strings you will use on your website
  5. Save again to update the .po and .mo files

If you wish to share your translations for other languages, please do not hesitate to contact us at support@hotelwp.com. This will be highly appreciated by your fellow citizens!

See this page to find your locale code.


How to import/export language files?

You can use the Languages (Import/Export language files) page to import or export a a .txt or a .po file (.po file are commonly used to store translations for multilingual softwares). Note that you do not have to use a .po file to translate the text displayed by HBook but the Import / Export might come in handy (for example if the translation is made by a third party).

iCal import/export/syncronization

HBook allows you to import, export and syncronize calendars using iCal feeds or files. HBook syncronizes hourly with the calendars added.

A recommended practice is to have HBook as your main calendar and to set two-ways syncronization between HBook and other ical calendars. You should not set any syncronization between two other calendars, if they already are syncronized with HBook.

Presentation of iCal syncronization table

Note that as ical is aimed at syncronizing calendars only, it does not update the information regarding payment, customer details or number of adults/children. You will have to edit these in the reservation list.

Shortcodes

5 shortcodes are included in the HBook plugin.

  1. [hb_booking_form]
  2. [hb_accommodation_list]
  3. [hb_availability]
  4. [hb_rates]

1. [hb_booking_form]

Use the [hb_booking_form] shortcode to display a booking form on your website.

Parameters:

Examples:

[hb_booking_form search_only="yes" redirection_url="http://www.abc.com/main-booking-form"]
With the following shortcode, your customer enter the check-in and check-out dates as well as the number of adults and children if requested. When he press the "Search" button, he is redirected to another page for the next step of the booking (selection of accommodation and extra-services, customer details, payment, confirmation).

[hb_booking_form redirection_url="http://www.abc.com/main-booking-form"]
With the following shortcode, your customer enter the check-in and check-out dates as well as the number of adults and children if requested. The results of the search appear and is it after having selected the accommodation type that he is redirected to another page. He will be able to select extra-services, enter customer details, etc...


2. [hb_accommodation_list]

Use the [hb_accommodation_list] shortcode to display a list of accommodation.

Parameters:

  • show_thumbnail: use that parameter to choose whether to display an accommodation thumbnail. Default: yes.
  • thumbnail_link: here you can set if you wish that the thumbnail is linked to the accommodation page or not. Default: yes.
  • title_tag: use that parameter to change the title heading. (h3, h4,...). Default is h3.
  • thumb_width: use that parameter to change the width of the thumbnail. Default is 150px.
  • thumb_height: use that parameter to change the height of the thumbnail. Default is 150px.

Examples:
[hb_accommodation_list thumbnail_link="no"]
[hb_accommodation_list title_tag="h4" thumb_width="300" thumb_height="200"]

Note that you can set the size of the thumbnail displayed in the search results in HBook->Forms page. See this section of the documentation.

3. [hb_availability]

Use the [hb_availability] shortcode to display an availability calendar.

Parameter:

  • accom_id: add this parameter if you want to display the calendar outside of an Accommodation page. You will find the accommodation ID in the accommodation type post right under the title. For example: [hb_availability accom_id="5"]
  • calendar_sizes: add this parameter if you want to specify the sizes of the calendar. By default the value of this parameter is "2x1, 1x1". It means that the calendar will have 2 columns if there are enough space to display them otherwise it will have one column.
    For example: [hb_availability calendar_sizes="3x2,2x2,1x1"] (3 columns and 2 rows, or 2 columns and 2 rows, or 1 colum and 1 row, depending on the available space)

4. [hb_rates]

Use the [hb_rates] shortcode to display a rates table.

Parameters:

  • accom_id: add the accom_id parameter if you want to display the calendar outside of an Accommodation page. You will find the accommodation ID in the accommodation type post right under the title. For example: [hb_rates accom_id="5"]
  • type: you can choose to display only one type of rate with the type parameter. There are 3 types of rates: normal (when there isn't more people than the normal occupancy), adult (rate per adult above the normal occupancy), child (rate per child above the normal occupancy). For example the following shortcode [hb_rates type="child"] will only display the rate per extra child.
  • season: use this parameter to display a rates table for one season only.
  • rule: use this parameter to display a rates table for one booking rule only.
  • days: use this parameter to display a rates table for a set of days only
    (for example [hb_rates days="4,5"] will display the rate for the Friday night and the Saturday night only).
  • show_global_price: set this parameter to yes to show global price instead of a price per night.
  • custom_text_after_amount: thanks to this parameter you can display a custom text after the price.

Examples:

[hb_rates show_global_price="yes" custom_text_after_amount="per week"] will display a global price with "per week" appended after the rate amount.

[hb_rates season="My season" rule="My rule"] will display a table rate for "My season" and "My rule" only.

Reservation page

All reservations made on your website will appear in the Reservation page. The reservation page is separated in 5 parts.

  1. Calendar
  2. Reservation list
  3. Block accommodation
  4. Add a reservation
  5. Export Reservations

Note that HBook allows you to set different user roles for reservation access and management. See here for more information.

A notice can appear on top of the Reservations page if there has been any errors of syncrinization. See iCal syncronization.


1. Calendar

  1. Select which accommodation type you wish to be displayed
  2. The current day is highlighted in light blue
  3. Go two weeks backward.
  4. Select a month of a year from the pop-up calendar
  5. Go two weeks forward.
  6. A confirmed reservation will appear in green
  7. A new reservation will appear in yellow.


2. Reservation list

Below is an example of what could be a reservation list:


Let's see now in details what is displayed in the list and what the possible actions are.

  • Reservation status:
    • A reservation can have 4 different status:
      1. Pending: the reservation needs confirmation. A pending reservation do not appear in the calendar of reservation. You can view that status only if you have set in HBook settings->Confirmation settings that a reservation have to be confirmed before dates are blocked out.
      2. New: the reservation has just been received and you have not yet acknowledged you read it (by clicking the green tick).
      3. Cancelled: the reservation has been cancelled but has not been deleted (you can still access details about this reservation but it will not appear in the calendar).
      4. Confirmed: Either a Pending reservation has been confirmed (See Confirmation settings ) or a New reservation has been read (the green tick has been clicked to acknowledge it has been read).

  • Comments, Payment status/information and Actions:
    1. To add a comment, click on Add a comment and do not forget to save.

    • You can do 3 types of actions on a reservation:
      1. Mark as Confirmed:
        • If you have set that a reservation have to be confirmed before dates are blocked out, this action will add the reservation to the calendar
        • If you have set that a confirmation email has to be sent, this action will as well send the confirmation email to the customer
        • If reservation do not have to be confimed, then this action will not do anything apart changing the statut to Confirmed which in this case mean that you acknowledge you have read the reservation.
      2. Cancel
      3. Delete

    • A reservation can have three payment status:
      1. Unpaid
      2. Not fully paid
      3. Paid

    1. Click here to mark a reservation as paid
    2. Click here to edit the payment information and enter an amount that has been paid. It will automatically update the "To be paid" information

  • Editing Customer information
  • You can easily edit the customer information. Simply click on Edit and the fields you have defined in Forms->Booking details form will appear to be modified.


  • Changing a reservation of accommodation type or/and accommodation number

    It is possible to allocate a different accommodation to a reservation. Note that it will not change the price.

    1. Click on Edit
    2. The system will retrieve all accommodations available for the dates. Select the accommodation type/number
    3. Click Save


Block accommodation

This is the tool you can use to set accommodations as unavailable. It can be useful if you have several closure periods during the year for example or if you receive booking from other source and wish to update availability without entering the reservation details.

  1. Select which Accommodation types are concerned.
  2. Select which Accommodation numbers are concerned.
  3. Select the date From when the accommodation is unavailable.
  4. Select the date up To when the accommodation is unavailable.
  5. Click on Block accommodation

A list of the accommodation you have blocked will be shown.


Add a reservation

Here you can manually add reservation. It can be used if you receive reservations from other source (phone, email...) and wish to enter the full details of the booking.

  1. Select a check-in date.
  2. Select a check-out date.
  3. Select the number of adults.
  4. Select the number of children.
  5. Select the accommodation type.
  6. Click on Check price and availability

Then, as summary of the search criteria with the details of the pricing, selection of extra-services and available accommodation will appear:

  1. You can set a different price than the one calculated by HBook
  2. Select the Accommodation
  3. You can enter the customer id for a returning customer or enter full customer details
  4. Here you can add a comment for the reservation
  5. Click on Create reservation

Export Reservations

It is possible to export your reservation in .csv file, which can be used for example with Excel.

  1. Click on Export reservations
  2. Select the information you wish to export
  3. Click on Download

Plugin Customization

In order to facilitate customization different filters and actions have been created:

  • hb_search_form_markup
  • hb_search_form_title
  • hb_details_form_markup
  • hb_language_list
  • hb_extra_name
  • hb_extras_form_markup
  • hb_resa_extra_formatting
  • hb_retina_scale_factor
  • hb_accommodation_taxonomies
  • hb_create_reservation
  • hb_create_customer
  • hb_reservations_updated
  • hb_blocked_accom_updated

When a customer makes a reservation the plugin also try to call these two global JavaScript functions:

  • hbook_show_accom_list
  • hbook_reservation_done

hb_search_form_markup

This filter is applied to the HTML mark up of the form which is used for searching available accommodation.

Parameters:

  • $output: (string) the HTML code of the form.
  • $form_id: (string) the id of the form as passed to the [hb_booking_form] shortcode via the form_id attribute.

hb_search_form_title

This filter is applied to the title of the search form.

Parameter:

  • $title: (string) the HTML code of the title of the search form.

Example:

function change_title_tag( $title ) {
    return str_replace( 'h3', 'h2', $title );
}
add_filter( 'hb_search_form_title', 'change_title_tag' );

hb_details_form_markup

This filter is applied to the HTML mark up of the form which is used for getting the customer details.

Parameter:

  • $output: (string) the HTML code of the form.

hb_language_list

This filter is applied to the list of languages managed by HBook in a multi-language website.

Parameter:

  • $langs: (array) a key (string) => value (string) array that contains information about the different languages (key is the language locale, value is the language name).

hb_extra_name

This filter is applied to the name of each extra service (extra services are displayed as a list after the accommodation selection).

Parameter:

    $display_name, $option, $price
  • $display_name: (string) name of the extra as it will be displayed
  • $extra: (array) information about the extra
  • $price: (array) price of the extra

hb_extras_form_markup

This filter is applied to the HTML mark up of the form which displays extra services.

Parameter:

  • $output: (string) the HTML code of the form.

hb_resa_extra_formatting

This filter is applied to the name of each chosen extra service (in emails sent by HBook).

Parameter:

  • $formatted_extra_name: (string) the formatted name of the extra service
  • $extra_name: (string) the name of the extra service
  • $extra_value: (string) value of the chosen option
  • $option_choice_name: (string) name of the chosen option

hb_retina_scale_factor

Parameter:

  • $retina_scale_factor: (integer) the scale factor applied to images displayed by HBook (by default the scale factor is 1).

Example:
Displaying images ready for 3x retina devices.

function custom_retina_scale_factor( $retina_scale_factor ) {
    return 3;
}
add_filter( 'hb_retina_scale_factor', 'custom_retina_scale_factor' );

hb_accommodation_taxonomies

This filter is applied to the taxonomies parameter which is passed to the register_post_type function used for creating the Accommodation custom post type.

Parameter:

  • $taxonomies: (array) list of taxonomies.

Example:
Adding categories to the Accommodation posts.

function categories_for_accommodation( $taxonomies ) {
	$taxonomies[] = 'category';
	return $taxonomies;
}
add_filter( 'hb_accommodation_taxonomies', 'categories_for_accommodation' );

hb_create_reservation

This action fires when a new reservation is added to the reservation database table.

Parameter:

  • $resa_info: (array) all of the new reservation information.

hb_create_customer

This action fires when a new customer is added to the customer database table.

Parameter:

  • $customer_info: (array) all of the customer information.

hb_reservations_updated

This action fires whenever the reservations database table is updated.

Parameter: None.

hb_blocked_accom_updated

This action fires whenever the blocked accommodation database table is updated.

Parameter: None.

 

JavaScript functions

hbook_show_accom_list

HBook plugin tries to call this function whenever the list of available accommodation is shown.

Example:
Launching a JavaScript function after the list of available accommodation has been shown.

In the functions.php of your child theme add:

add_action( 'wp_enqueue_scripts', 'enqueue_my_js_scripts' );

function enqueue_my_js_scripts() {
	wp_enqueue_script( 'my-script', get_stylesheet_directory_uri() . '/my-script.js', array(), null, true );   
}
and in the child theme directory create a my-functions.js file that contains:
function hbook_show_accom_list() {
	my_js_function();
}

hbook_reservation_done

HBook plugin tries to call this function whenever a reservation is successfully completed by a customer.

FAQ

Find an immediate answer to many Frenquently Asked Question in our knowledgebase