Advertisement:

Author Topic: Search filter;Category multiple select  (Read 511 times)

goodisme

  • Newbie
  • *
  • Posts: 24
Search filter;Category multiple select
« on: September 29, 2017, 01:50:57 pm »
Hi guys, i am trying to make the category selection in the search page choose a category>subcategory like in item-post.

this code makes it select only the main category:

Code: [Select]
function osc_categories_select_sahara($name = 'sCategory', $category = null, $default_str = null) {
        if($default_str == null) $default_str = __('All Categories');
        if(is_array($category)) $category['pk_i_id'] = $category[0];
        CategoryForm::category_select(Category::newInstance()->findRootCategories (), $category, $default_str, $name);
    }

can anyone help me modify it to select a  subcategory after main category like in item-post and allow the user to leave the subcategory blank if only interested in main category?

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Search filter;Category multiple select
« Reply #1 on: September 29, 2017, 02:21:57 pm »
Hi. Look in the admin file for that code and just paste it in item-post.php instead of the actual one.

It will work(tested on bender)

Sorry, I missunderstood.