Hi,
I would like to be able to search, first select the category and then the sub-category.
this is the code that right now I show all categories and subcategories.
<select name="sCategory" id="sCategory" class="selectpicker" data-width="100%" >
<option value=""><?php _e('Tutte le Categorie', 'metrobar'); ?></option>
<?php osc_goto_first_category();
while ( osc_has_categories() ) { ?>
<optgroup label="<?php echo osc_category_name() ; ?>">
<?php $i = 0; while ( osc_has_subcategories() ) { ?>
<option value="<?php echo osc_category_id() ; ?>" <?php if(Params::getParam('sCategory') == osc_category_id()) { ?>selected<?php } ?>><?php echo osc_category_name() ; ?></option>
<?php $i++ ; } ?>
<?php View::newInstance()->_erase('subcategories') ; ?>
</optgroup>
<?php } ?>
</select>