Loading


Advertisement:

Author Topic: Search Side bar with Regions and Cities, How?  (Read 352 times)

Ezkiel

  • Newbie
  • *
  • Posts: 5
Search Side bar with Regions and Cities, How?
« on: October 19, 2016, 02:17:36 pm »
Hi everyone,

I want show in my search sidebar, the regions and cities with listings!
example:
Lisbon+
Porto +

I click in Lisbon and show the cities from the Lisbon Region with listings (I don't need the countries)

Lisbon
   Lisbon (98)
   Mafra (2)
Porto +
------------------------

I found this code and I use, but only show the cities!

Code: [Select]
<fieldset>
            <h3><strong><?php _e("City"'bender') ; ?></strong></h3>
        <ul>
        <?php 
$myreg_id '';
if( osc_search_region() != '' ) {
$v_reg_id  Region::newInstance()->findByName(osc_search_region());
if(isset($v_reg_id['pk_i_id'])) {
$myreg_id $v_reg_id['pk_i_id'];
}
}
while(osc_has_list_cities($myreg_id) ) { ?>

        <li><a href="<?php echo osc_search_url( array( 'sCity' => osc_list_city_name() ) ) ; ?>"><?php echo osc_list_city_name() ; ?><em> (<?php echo osc_list_city_items() ; ?>)</em></a></li>
        <?php ?>
        </ul>
        </fieldset>

thank you !