Plugin instalation

To be able to use iTravel WordPress plugin first copy the plugin files into your WordPress plugins folder. After copying the plugin files, the plugin should become visible under the WordPress “Installed plugins” page. Now you can activate the plugin.

itravel plugin activation

Once activated, you can use shortcodes for displaying variousitravel sections on your pages and posts.

itravel shortcodes description

itravel plugin uses shortcodes for displaying various parts of its functionality.

Shortcode Description Optional parameters
[itravel-accommodation-search-control] Shortcode used for displaying accommodation search box
  • xslt_path – an absolute path to the custom XSLT file used for styling output of the shortcode
[itravel-accommodation-search-results] Shortcode used for displaying accommodation search results
  • xslt_path – an absolute path to the custom XSLT file used for styling output of the shortcode
  • category_id – if set, the plugin will show results with accommodation with the selected category
  • destination_id – if set, the plugin will show results with accommodation from the selected destination
  • region_id – if set, the plugin will show results with accommodation from the selected region
  • country_id – if set, the plugin will show results with accommodation from the selected country
  • destination_name – if set, the plugin will show results with accommodation from the destination with selected name
  • persons – if set, the plugin will show results for this number of persons
  • language_id – if set, the plugin will show results in this language
  • currency_id – if set, the plugin will show results in this currency
  • page_size – if set, the plugin will show this many results per page
[itravel-accommodation-detailed-description] Shortcode used for displaying accommodation detailed description
  • xslt_path – an absolute path to the custom XSLT file used for styling output of the shortcode
[itravel-tour-search-control] Shortcode used for displaying tours search box
  • xslt_path – an absolute path to the custom XSLT file used for styling output of the shortcode
[itravel-tour-search-results] Shortcode used for displaying tours search results
  • xslt_path – an absolute path to the custom XSLT file used for styling output of the shortcode
  • category_id – if set, the plugin will show results with tours with the selected category
  • destination_id – if set, the plugin will show results with tours from the selected destination
  • region_id – if set, the plugin will show results with tours from the selected region
  • country_id – if set, the plugin will show results with tours from the selected country
  • destination_name – if set, the plugin will show results with tours from the destination with selected name
  • persons – if set, the plugin will show results for this number of persons
  • language_id – if set, the plugin will show results in this language
  • currency_id – if set, the plugin will show results in this currency
  • page_size – if set, the plugin will show this many results per page
[itravel-tour-detailed-description] Shortcode used for displaying tour detailed description
  • xslt_path – an absolute path to the custom XSLT file used for styling output of the shortcode
[itravel-transportation-search-control] Shortcode used for displaying transportation search box
  • xslt_path – an absolute path to the custom XSLT file used for styling output of the shortcode
[itravel-transportation-search-results] Shortcode used for displaying transportation search results
  • xslt_path – an absolute path to the custom XSLT file used for styling output of the shortcode
  • category_id – if set, the plugin will show results with transportation with the selected category
  • pickup_destination_id – if set, the plugin will show results with transportation from the selected pickup destination
  • persons – if set, the plugin will show results for this number of persons
  • language_id – if set, the plugin will show results in this language
  • currency_id – if set, the plugin will show results in this currency
  • page_size – if set, the plugin will show this many results per page
[itravel-transportation-detailed-description] Shortcode used for displaying transportation detailed description
  • xslt_path – an absolute path to the custom XSLT file used for styling output of the shortcode
[itravel-booking-form] Shortcode used for displaying the booking form. Also, this shortcode is the same for all product types(accommodation, transportation, tours etc..)
  • xslt_path – an absolute path to the custom XSLT file used for styling output of the shortcode
  • cart – enables the shopping cart
[itravel-activity-search-results] Shortcode used for displaying activity search results
  • xslt_path – an absolute path to the custom XSLT file used for styling output of the shortcode
  • category_id – if set, the plugin will show results with activities with the selected category
  • destination_id – if set, the plugin will show results with activities from the selected destination
  • region_id – if set, the plugin will show results with activities from the selected region
  • country_id – if set, the plugin will show results with activities from the selected country
  • destination_name – if set, the plugin will show results with activities from the destination with selected name
  • persons – if set, the plugin will show results for this number of persons
  • language_id – if set, the plugin will show results in this language
  • currency_id – if set, the plugin will show results in this currency
  • page_size – if set, the plugin will show this many results per page

An example of using a shortcode in a WordPress page:
[itravel-accommodation-search-results category_id=”5″ destination_id=”7″ currency_id=”978″ page_size=”10″]

This shortcode will display all the accommodations with category whose ID is 5, which are in a destination whose ID is 7, the results will be in a currency whose ID is 978 and each page will contain 10 results.

You can find IDs for categories, destinations, currencies etc. in the back office.

Also, important – you can’t use destination_id attribute and then input an ID of the country or a region. It will show no results in that case. If you wish to display the results for a country or region, use country_id or region_id attribute.

Notice that activities only have a search results shortcode. That means that the plugin currently doesn’t support a search box for activities, in which the customers would pick the search parameters themselves. Instead, you can use optional parameters with activity search results shortcode to filter which activities you wish to display. You can create as many such search results as you like, with different parameters set. Activities also don’t have their own detailed description shortcode, and you should use [itravel-accommodation-detailed–description] shortcode to display activity’s detailed description.

If you wish to enable the shopping cart, which allows your customers to book multiple products at once instead of one by one, you need to include the cart attribute with the booking form shortcode, like this:
[itravel-booking-form cart=”1″]

Displaying itravel controls inside pages

To be able to display any of the itravel controls on the WordPress page you simply have to insert the shortcode of that control on the desired page.

accommodation search control shortcode

For each shortcode (search form, results, detailed description and booking form) you should have a separate page defined in WordPress that is a place holder for the widget markup.

wordpress pages

Refresh your site and enjoy the newly added itravel widget!

accommodation search results

accommodation detailed view

booking form

Additional settings

Change API settings

By default itravel plugin connects to the itravel demo website to fetch travel objects (http://demo.itravelsoftware.com). In order to change the API adress where the plugin connects, you need to edit some parameters in the itravelGeneralSettings.php file located in itravelPlugin/PHPAPIIntegration folder like the API url, API username and password.

You simply edit the values of the following parameters: $itravelAPIURL, $itravelAPIUsername, $itravelAPIPassword (image below).

itravel general settings

File and permalink path settings

It is of great importance to check the itravel plugin scripts and XSLT stylesheet paths as well as PHP URLs and WordPress custom permalink paths. If the “wp-content” folder is the root of your site, you do not have to bother with the paths, but if this is not the case you should edit the plugin’s paths as described below.

  • in itravelPlugin/itravel-plugin.php file, at line 597, some stylesheets and scripts are being included. All stylesheets and scripts whose file paths start with “/wp-content/” should start with “/path-from-root-of-the-website-to-wp-content-directory/wp-content/”
  • in itravelPlugin/PHPAPIIntegration/itravelGeneralSettings.php file, there is also some PHP files and stylesheets including done as well as URL paths (permalinks) defining. Once again all file paths that start with “/wp-content/” should start with “/path-from-root-of-the-website-to-wp-content-directory/wp-content/” and all permalink URLs (itravelPageAccommodationSearchFormPath, itravelPageAccommodationSearchResultsPath, itravelPageAccommodationDetailedDescriptionPath …) should start with “/path-from-root-of-the-website-to-wp-content-directory/permalink-structure/”
  • in itravelPlugin/SamplePages/head.php file, also all the file paths starting with “/wp-content/” should start with “/path-from-root-of-the-website-to-wp-content-directory/wp-content/”

Pages as shortcode place holders

In order to correctly connect the pages containing separate itravelwidgets it is of great importance to match the page names and URL paths in itravelPlugin/PHPAPIIntegration/itravelGeneralSettings.php file (parameters in the section labeled with “Default widget place holders paths”). For example, if the path to your search results is “http://demo-wp-plugin.itravelsoftware.com/accommodation-results/” (image below)

page URL sample

the itravelPageAccommodationSearchResultsPath parameter should be “/accommodation-results/” (image below). Please notice how the parameter value is the same as the part of the above URL without the website default URL part (http://demo-wp-plugin.itravelsoftware.com).

itravel permalinks

The main thing here is to be careful when setting URL paths and permalinks. Your website root path is important!