Setting up the Search Box

The Open House theme features an advanced search box where you can perform a specific search for a property based on location, number of bedrooms, bathrooms, minimum, maximum price, and property type.

The Locations, minimum price, maximum price, and Property Type need to be configured. This page details how to do that.

Location

Searching by location is quite powerful. Before going through this, please check out the theme demo to review how it functions. This tutorial will make more sense. When you click on the main “Location” dropdown, a dropdown of all the U.S. states appears. (This can be changed to anything you like). Because U.S. States is quite general, you may want to narrow down the location a bit. So choose a state from the list. In a couple seconds another dropdown menu appears with more specific locations in the selected state. In the demo, state Counties are shown. Again, this can be changed to meet your needs.

In this documentation, i refer to the first Location dropdown as “Primary search location”, and I refer to the second location dropdown as “Secondary search location”.

Keep in mind that the Secondary Search Location is optional, and is only needed if your Primary Search Locations are large in scope.

Customizing the Primary Search Locations

In Theme Options, in the General section, you will see a section to enter your Primary Search Locations. By default you’ll see all 50 U.S. States. But feel free to change it to however general or specific you need. For example, countries, regions, cities, zip codes, etc. Enter each location on a separate line.

If you will only have the Primary Search Locations (not the Secondary Search Locations), then in Theme Options, in the General section, be sure to “disable” the Secondary Search Locations.

Adding Secondary Search Locations

First, in Theme Options, in the General section, be sure to enable “Secondary Search Locations”.

This part is relatively tricky, so I think the best way to learn how this works is to look at the demo. As I have mentioned a few times, the Primary Search Locations default to U.S. States. So in this tutorial I will assume you have the same. Lets choose a State: California, as an example. When you click on California, a secondary listbox appears with Counties in California. Where are the counties for California stored? They are in a folder called /secondary_search_locations, right in the root of your site. Go in that folder, and you’ll see 50 javascript files. One for each state. The Counties for California are in the California.js file. Open that file. You’ll see each County is on it’s own line. It should be self explanatory as to what you need to edit assuming you’re not using States and Counties.

The key here is that each javascript file must be in the /secondary_search_locations folder and must have the EXACT SAME NAME (case sensitive) as it’s name in the Primary Search Locations list that you set in Theme Options.

Remember, the theme is set to States and Counties, but you will probably have to customize this to your own needs. I think now that we saw how the California state works, that you will be able to create your own Primary and Secondary Search Locations.

Using this structure of Primary and Secondary Locations is very flexible, and is by far the most powerful search location feature on Themeforest.

Customizing the Max and Min Price

You will need to specify the minimum and maximum property prices to be used in the advanced search. For this, you will need to edit some HTML. But it’s easy since you’re just replacing the demo numbers with your own.

Open the /includes/custom/customsearchformfields.php file (/includes/customsearchform.php file if you are using a version of the theme downloaded 5/23/2010 or earlier). You’ll see 2 chunks of HTML labeled Minimum Price and Maximum Price. Don’t edit the FIRST entry of each dropdown. But other than that, you’re free to edit the numbers of any of the other lines.

Note: for the “value”, make sure the numbers do NOT include decimals, commas, or currency symbols. And for the number between the

Editing the Property Types

By default, the Search allows you to search by Property Types of Single Family, Townhome, Condo, and Apartment. But you can easily edit this list. In Theme Options, in the General section there is a section to edit the “Property Types”. Just enter each one on a new line.