In functions.php replace function veronika_get_term with:
function veronika_get_term($term = '', $country = '', $region = '', $city = ''){
if( $term == '') {
if( $city <> '' && is_numeric($city) ) {
$city_info = City::newInstance()->findByPrimaryKey( $city );
$region_info = Region::newInstance()->findByPrimaryKey( $city_info['fk_i_region_id'] );
return $city_info['s_name'] . ' - ' . $region_info['s_name'];
}
if( $region <> '' && is_numeric($region) ) {
$region_info = Region::newInstance()->findByPrimaryKey( $region );
return $region_info['s_name'];
}
if( $region <> '') {
$location = $region;
if( $city <> '' ) {
$location .= ' - ' . $city;
}
if( $country <> '') {
if(strlen($country) == 2) {
$country_info = Country::newInstance()->findByCode( $country );
$location .= ' (' . $country_info['s_name'] . ')';
} else {
$location .= ' (' . $country . ')';
}
}
return $location;
}
if( $country <> '' && strlen($country) == 2 ) {
$country_info = Country::newInstance()->findByCode( $country );
return $country_info['s_name'];
}
} else {
return $term;
}
}