Search Category not Working on SearchBar

Please post bugs you have found in tuffclassified theme. If you have fix for that post it too.
Do not post anything else, issue related to third party plugins should not be posted here.
Locked
renas
Starter
Posts: 30
Joined: Sun Jun 14, 2015 5:33 pm

Search Category not Working on SearchBar

Post by renas »

Hi,

When selecting the main category instead of child. It gives all ads from the database. So the search is only working on child categories. This is a critical issue. :(

Tks,

Renato
User avatar
tuffadmin
Site Admin
Posts: 1236
Joined: Tue Jan 29, 2013 7:31 pm

Re: Search Category not Working on SearchBar

Post by tuffadmin »

replace category_select function (First static function in class) in tfcform.php with this one.

Code: Select all

static public function category_select($categories, $category, $default_item = null, $name = "sCategory")
        {
            echo '<select class="form-control" name="' . $name . '" id="' . $name . '">';
            if(isset($default_item)) {
                echo '<option value="">' . $default_item . '</option>';
            }
            foreach($categories as $c) {
                echo '<option value="'. $c['pk_i_id'] . '"' . ( ($category['pk_i_id'] == $c['pk_i_id']) ? 'selected="selected"' : '' ) . '>' . $c['s_name'] . '</option>';
                if(isset($c['categories']) && is_array($c['categories'])) {
                    CategoryForm::subcategory_select($c['categories'], $category, $default_item, 1);
                }
            }
            echo '</select>';
        }
No support for unnecessary PM, use forum for support queries.
Please give us good review if you bought our theme from Osclass Market
renas
Starter
Posts: 30
Joined: Sun Jun 14, 2015 5:33 pm

Re: Search Category not Working on SearchBar

Post by renas »

Tks,

Problem resolved. :)
Locked