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.
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.
|[itravel-accommodation-search-control]||Shortcode used for displaying accommodation search box||
|[itravel-accommodation-search-results]||Shortcode used for displaying accommodation search results||
|[itravel-accommodation-detailed-description]||Shortcode used for displaying accommodation detailed description||
|[itravel-tour-search-control]||Shortcode used for displaying tours search box||
|[itravel-tour-search-results]||Shortcode used for displaying tours search results||
|[itravel-tour-detailed-description]||Shortcode used for displaying tour detailed description||
|[itravel-transportation-search-control]||Shortcode used for displaying transportation search box||
|[itravel-transportation-search-results]||Shortcode used for displaying transportation search results||
|[itravel-transportation-detailed-description]||Shortcode used for displaying transportation detailed description||
|[itravel-booking-form]||Shortcode used for displaying the booking form. Also, this shortcode is the same for all product types(accommodation, transportation, tours etc..)||
|[itravel-activity-search-results]||Shortcode used for displaying activity search results||
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:
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.
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.
Refresh your site and enjoy the newly added itravel widget!
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).
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)
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).
The main thing here is to be careful when setting URL paths and permalinks. Your website root path is important!