How to Integrate the iPRO Search Widget With Your Website
- Introduction
- Custom Scripts Added in Section
- Custom Scripts Added to Footer
- Adjusting the Start Date for Search Check In
- Adding the Search Form to Your Homepage
- Adding Filters to Your Search Form
- Default Search Form Code
- Adding the Custom Style Sheet to Your Website
- Building Your Own Search Results Page
- Integration of iPRO Search Results on Your New Page
- Full Example of Search Form and Results Integration
Introduction
If you wish to use the iPRO search plugin, you can easily enhance your website with powerful search and online booking functionality from iPRO.
Before you start, you will need to add some custom code to the <HEAD> section of your website.
Custom Scripts Added in <HEAD> Section
Please follow these steps:
- Add the Following Code:
Copy the script below and paste it into the <HEAD> section of your website. Additionally, place the script in an isolated JavaScript file for better organisation and maintenance.
Custom Scripts Added to Footer
Please copy and paste the following code into the footer section of your website, just before the closing </BODY> tag:
Adjusting the Start Date for Search Check In
To control the earliest date users can search for available bookings, you can adjust the startDate parameter in your code. This feature is especially useful for managing last-minute bookings. For instance, setting startDate: "+2d" will only allow searches starting from 2 days from today's date.
In the code snippet below, you will see how to configure this parameter:
Example Configuration
- startDate: "+0d": Allows searches starting from today.
- startDate: "+1d": Allows searches starting from tomorrow.
- startDate: "+2d": Allows searches starting from 2 days from today.
Implementation
To adjust the parameter:
- Locate the startDate line in your datepicker configuration.
- Change the value to suit your requirements (e.g., "+2d" for searches starting from 2 days from today).
Adding the Search Form to Your Homepage
Depending on the website platform you are using, you will need to add an embed code block or code injection block to insert the search form.
Steps to Add Locations to Your Search Form
1. Locate the Search Form Code:
- In your search form code, find the following section:
- Replace xxxx with the relevant iPRO location ID for each location.
- Customise the displayed name for each location (e.g., location-a, location-b).
- Navigate to the 'Properties' tab in your iPRO system.
- Locate the ID for each property or location you want to include in the search form.
Example
Here's an example with two locations added:
By following these steps, you can add a functional and customised search form to your homepage, allowing users to search properties by specific locations.
Adding Filters to Your Search Form
To enhance your search form, you can add various filters based on amenities or property types. In the search form code, look for the section with select id="attrs" inside the <div class="cc-input-group">. Here, you will add your filters and enter the relevant iPRO amenity IDs.
Steps to Add Filters
1. Locate the Search Form Code:
Find the following section in your search form code:
2. Add Filters
- Customize the filters by mapping them to the correct iPRO IDs.
- You can add multiple groups of filters. For example, you might have filters for pets, property types, and distances.
3. Example Filters
- Below is an example of how to add a filter for properties that allow pets and another for property types, such as cottages.
Example
Pet Filter
To add a filter for properties that allow pets:
Where 12345 is the iPRO amenity ID for pet-friendly properties.
Property Type Filter
To add a filter for cottages:
Where 8830 is the iPRO amenity ID for cottages.
Sample Implementation
Here’s how you can implement these filters in your form:
Customization
You can add as many filters as required, simply by naming the filter and mapping it to the correct ID within iPRO.
By customising your search form with these filters, you provide users with a more refined and useful search experience, tailored to their specific needs.
Default Search Form Code
Below is the default search form code. Please edit as required and then copy and paste this code on the pages where you want the search form on your website.
Important Notes
- Update the URL: Change https://www.yourdomain.com/search to the URL where you want to direct users after they click 'Search'.
- Update Locations: Match the locations to your iPRO locations or remove the location section if not needed.
- Update Amenities: Match the amenities to your iPRO amenities or remove these filters.
Adding the Custom Style Sheet to Your Website
To ensure the search form has the base layout required (i.e., horizontal), please add the following custom styles to your stylesheet. Note that if you are already using Bootstrap for the date picker, you may need to remove or update some of these classes.
Building Your Own Search Results Page
To create a custom search results page, follow these steps:
1. Add the Following Code:
- Insert the following code between the <HEAD></HEAD> tags of the page where you wish to display the search results. Ensure that the script is also placed in an isolated JavaScript file for better organization and maintenance.
2. Adjusting iFrame Size Automatically:
- The script will automatically adjust the size of the iframe based on the number of properties displayed. This allows you to use the iPRO Search Form on this page, providing greater flexibility with your filters.
3. Update the URL to match the iPRO Search Results Page
- Please update the www.mydomain.com to the domain used for the iPRO Booking System i.e booking.mydomain.com/search or secure.mydomain.com/search
By implementing this, you can customise the search results page to better fit your needs and enhance the user experience with flexible filtering options provided by the iPRO Search Form.
Example of the search results page
Integration of iPRO Search Results on Your New Page
To display the search results on your new web page, you'll need to include the following snippet of code where you want the search results to appear. This assumes that your search form is correctly configured to submit to the appropriate URL where your search results will be fetched and displayed.
Full Example of Search Form and Results Integration
Here is a complete example that integrates the search form with the search results section.
Homepage Search Form
Search Results Page
This search results page has a custom search form and the switch form within iPRO is disabled

Search Results Page
This search results page, utilising the iPRO Filter, which is controlled within the iPRO CMS
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article