searchosclass

Osclass Drop-down selection for city at search insted of category selection


the script is osclasss

This is the original code

?php  if ( osc_count_categories() ) { ?>
            <div class="cell selector">
                <?php osc_categories_select('sCategory', null, __('Select a category', 'bender')) ; ?>
            </div>
            <div class="cell reset-padding">
        <?php  } else { ?>
            <div class="cell">
        <?php  } ?>
            <button class="ui-button ui-button-big js-submit"><?php _e("Search", 'bender');?></button>
        </div>

How can I edit this code to make the user select a city for search not a category ?

Thank you everyone.


Solution

  • I found the solution =) Thanks to https://stackoverflow.com/users/3465265/key

    Just add this code

    <?php $aCities = City::newInstance()->listAll(); ?>
    <?php if(count($aCities) > 0 ) { ?>
    <select name="sCity" id="sCity">
    <option value=""><?php _e('Select a city...')?></option>
        <?php foreach($aCities as $city) { ?>
        <option value="<?php echo $city['s_name'] ; ?>"><?php echo $city['s_name'] ; ?></option>
        <?php } ?>
    </select>
    <?php } ?>