How do I turn on the country and/or city fields within my site search page?

This modification will only work on pre v5 installations of the software

The admin tool LISTING SETUP > FIELDS TO USE has settings to turn on the use of the city and country fields within the software but these fields do not appear in the site search field when you turn them on in the above admin tool. The reason the country field is this way is that so few of the site using our software are multiple country sites that need this field turned on within the search form specifically yet want it displayed in several other places this field was commented out within the php code of the software.

The city field does not display for a slightly different reason. The city field in the search form can cause more problems than it solves. With the proliferation of suburbs many searchers could be missing listings right next to them because the city search does an exact match search for the city and not a proximity search which they may be expecting. Problems in spelling city name is another major problem with the city search. Cities may be spelled correctly between a person posting a listing and another person looking for that listing. Fort Lauderdale will not match Ft Lauderdale even though both are acceptable spellings of the city's name. Because of these problems we have suggested that area based searches be based on the postal/zip codes. The script can do proximity searches with the use of the longitude/latitude data that comes with the postal/zip code addon.

If you still wish to use these fields in your site search form you can. The code to search by these fields is still in the php code but has been commented out. The changes you will need to make these fields appear are within the search_form function of the search_class.php file.

To uncomment the city form field search for the following line within the php code mentioned above:

//if the client wants to search by city they can uncomment
//otherwise the zip filter feature makes this unusable

/* if ($this->field_configuration_data->USE_CITY_FIELD)
{
   //search by city
   ......
}*/
You will need to remove the comments coding to make the above appear like:
//if the client wants to search by city they can uncomment
//otherwise the zip filter feature makes this unusable
if ($this->field_configuration_data->USE_CITY_FIELD)
{
   //search by city
   ......
}
To uncomment the country field to make it appear in the default search form look for the following php code:
//un-comment the following to add a drop down for countries.
/* 
//Begin Commenting out
if ($this->field_configuration_data->USE_COUNTRY_FIELD)
{
   .......
}
// End Commenting out
*/
You will need to remove the comments coding to make the above appear like:
//un-comment the following to add a drop down for countries.


//Begin Commenting out
if ($this->field_configuration_data->USE_COUNTRY_FIELD) 
{
   .....
}
// End Commenting out
our site same settings that turn on the use of the city and country fields within the
Properties ID: 000111   Views: 8477   Updated: 2 years ago