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).



Season setting examples:

  1. Same rate all year long:
  2. Week-end rate:
  3. Low season, medium season and high season:


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.

Advanced booking rules

This is a powerful feature that will enable you to define settings conditionally. 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.
  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.

Booking rules setting examples:

  1. Compulsory check-in and check-out on Saturday:
  2. Minimum stays depending on the Accommodation type:
  3. 2-night minimum stay for people check-in on a Friday:
  4. Week, Week-end and Midweek stay with special rates:
  5. 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_paypal_confirmation]
  3. [hb_accommodation_list]
  4. [hb_availability]
  5. [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"]
[hb_booking_form paypal_return_url="http://www.abc.com/paypal-confirmation-page"]


2. [hb_paypal_confirmation]

This shortcode must be added on the page which is displayed when a customer made a payment on Paypal and is coming back on your website. You can entered any text that will be displayed only on payment confirmation inside the shortcode.

Examples:
With specific content to display after payment:
[hb_paypal_confirmation] Add your content here... [/hb_paypal_confirmation]

If you do not have any specific content to add you can use the shortcode like this: [hb_paypal_confirmation]


3. [hb_accommodation_list]

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

Parameters:

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.

4. [hb_availability]

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

Parameter:


5. [hb_rates]

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

Parameters:

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.


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:

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

hb_search_form_markup

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

Parameters:

hb_search_form_title

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

Parameter:

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:

hb_language_list

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

Parameter:

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:

hb_extras_form_markup

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

Parameter:

hb_resa_extra_formatting

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

Parameter:

hb_retina_scale_factor

Parameter:

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:

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:

hb_create_customer

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

Parameter:

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

  1. How to find HBook purchase code?
  2. How to add an accommodation post in a menu?
  3. Where do I find the accommodation ID needed for "accom_id" parameter in the shortcodes?
  4. How to set up WPML plugin with HBook?
  5. How to set up Polylang plugin with HBook?
  6. How can I give different access to different users to the Reservation page?
  7. What is Paypal Sandbox for?
  8. PayPal error : Security header is not valid. What does it mean?
  9. Why can I see a reservation with grey "Processing" status that I can not delete?
  10. How to add a link to my Terms and Conditions page in the Terms and Conditions section?

1. How to find my purchase code?

Go to the Downloads page on CodeCanyon, click Download and then click Licence certificate and purchase code Open the licence file: it contains several details, among them is your purchase code.


2. How to add an accommodation post in a menu?

If you want to add an "Accommodation post" in a menu follow these steps:

1. On the menu page click Screen Options.

2. Check the Accommodation box.
3. Select "Accommodation posts" in the Accommodation accordion.


3. Where do I find the accommodation ID needed for "accom_id" parameter in the shortcodes?

You will find the accommodation ID in the accommodation type post right under the title.


4. How to set up WPML plugin with HBook?

Once you have activated and configured WPML plugin you need to make the "Accommodation Custom posts" translatable.

  1. Click Translation options
  2. Select Translate
  3. Click Save

You can now translate the Accommodation pages. Note that you don't have to enter the Accommodation settings in the translated page again (except the Description fields).


5. How to set up Polylang plugin with HBook?

Once you have activated Polylang plugin you need to make the "Accommodation" translatable.

  1. Click Languages to access the Polylang setting page
  2. Click on Settings and then on Custom post types and Taximonies
  3. Check the Accommodation box
  4. Click Save Changes

Note that you need as well to make sure that all posts have a language assigned. If this is not the case you will see the following screen in Polylang menu: You need to click on the link to set them all to the default language.

You can now translate the Accommodation pages. Note that you don't have to enter the Accommodation settings in the translated page again (except the Description fields).


6. How can I give different access to different users to the Reservation page?

Two different user roles are added by HBook:

. When you create or edit a user in Users, you can select one of the two above role in the dropdown list.


7. What is the Paypal Sandbox for?

The Paypal Sandbox can be used to test payment. It does not proceed real payments but fake ones and allows you to check that the payment process through Paypal is working before accepting real payments.

If you wish to test payments using the Paypal Sandbox, you will need to have Sandbox API Username, Password and Signature. They are different than the ones use for real payments. You can learn more here on Paypal documentation.

To use Paypal Sandbox with HBook, you will need to enter your Sandbox API Credentials (Username, Password and Signature) in Hbook->Payment->Paypal Settings. Do not forget to set "Use Paypal Sandbox" to "yes".


8. PayPal error : Security header is not valid. What does it mean?

This error normally happens only when you have not entered properly your API credentials, for example if you have entered the sandbox API instead of the live API. You should retype your API Username, Password and Signature and make sure that you enter Sandbox API if you have set "yes" to "Use Paypal Sandbox" in HBook->Payment and Live API of you have set "no" to "Use Paypal Sandbox" in HBook->Payment.


9. Why can I see a reservation with grey "Processing" status that I can not delete?

The processing status is normal when Paypal payment is processed, so it should be there but only for a very short time. It disappear once the payment is completed and the customer is redirected to the Thank you page. If a payment is not completed (for example the customer clicked the back button while Paypal is processing the payment or he was interrupted by a phone call...), the reservation will have the status "Processing" for one hour. After one hour, the not-completed reservation is deleted and the room is again available for these dates.


10. How to add a link to my Terms and Conditions page in the Terms and Conditions section?

In HBook->Misc, you will find a setting to display Terms and Conditions section. Once you have set that setting to "Yes", you can customize the text displayed in Hbook->Text->Book now area. If you wish to add a link to your terms and conditions page, it will look like this:
I have read and I accept the <a href="mysite.com/terms-and-condition-url">terms and conditions</a> for this booking.