Critical Search Issue

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

Critical Search Issue

Post by renas »

Hello,

Searchbar on side do not work properly. This is critical as most of the search don't work as expected by osclass, osclass custom fields and osclass plugins like Car or Realty.

If i select Region and after this category Region is not taken in account. Selecting a City the search will work but it will not load the dropdown.

Notice: Use of undefined constant sRegion - assumed 'sRegion' in /...themes/tuffclassified/search_sidebar.php on line 54

Notice: Undefined index: sRegion in .../themes/tuffclassified/search_sidebar.php on line 54

I don't think this is getting properly the values frm the search. This is probably one of the problems. If any extra filed selected the search don't work. It's not taking in account extra fields also.

I am very concerned about this issue.

Tks,

Renato
renas
Starter
Posts: 30
Joined: Sun Jun 14, 2015 5:33 pm

Re: Critical Search Issue

Post by renas »

For the Search Sidebar Issue on City it need to be replaced on line 54 the search_sidebar.php:

From:

Code: Select all

<?php 	$regionId = $_GET[sRegion]; 
To:

Code: Select all

<?php 	$regionId = Params::getParam('sRegion'); 
;)
renas
Starter
Posts: 30
Joined: Sun Jun 14, 2015 5:33 pm

Re: Critical Search Issue

Post by renas »

Looking further on this issue. All fields on Osclass are related with Category.

This is why most of the Themes use something like this ti store information about the categories.

Code: Select all

<?php
        $aCategories = osc_search_category();
        foreach($aCategories as $cat_id) { ?>
            <input type="hidden" name="sCategory[]" value="<?php echo osc_esc_html($cat_id); ?>"/>
        <?php } ?>
I do understand that Tuffclassified Theme is using a diferent approach with a filter by link. Even so Bender do use too and this works.

Inserting this code on sidebar code the custom fields work. Looking for further information if this is the best approach.

A good improvement to the category list is to list the level of the categories where the user are searching. If user search "Vehicles" -> "Cars" it doesn't seem very useful to have only a rollback to "All Categories".

Tks,

Renato
renas
Starter
Posts: 30
Joined: Sun Jun 14, 2015 5:33 pm

Re: Critical Search Issue

Post by renas »

And some info on what Bender uses.

Code: Select all

function bender_sidebar_category_search($catId = null)
{
    $aCategories = array();
    if($catId==null) {
        $aCategories[] = Category::newInstance()->findRootCategoriesEnabled();
    } else {
        // if parent category, only show parent categories
        $aCategories = Category::newInstance()->toRootTree($catId);
        end($aCategories);
        $cat = current($aCategories);
        // if is parent of some category
        $childCategories = Category::newInstance()->findSubcategoriesEnabled($cat['pk_i_id']);
        if(count($childCategories) > 0) {
            $aCategories[] = $childCategories;
        }
    }

    if(count($aCategories) == 0) {
        return "";
    }

    bender_print_sidebar_category_search($aCategories, $catId);
}
renas
Starter
Posts: 30
Joined: Sun Jun 14, 2015 5:33 pm

Re: Critical Search Issue

Post by renas »

I also noticed that categories are not ordered. I do think they should be.

Changed on search_sidebar.php

Code: Select all

	$conn = getConnection();
	$sql = "SELECT pk_i_id FROM `".DB_TABLE_PREFIX."t_category` where fk_i_parent_id=".$parentId." ORDER BY i_position";
	if (!($parentId)){
	$sql = "SELECT pk_i_id FROM `".DB_TABLE_PREFIX."t_category` where fk_i_parent_id IS NULL ORDER BY i_position";
	}
User avatar
tuffadmin
Site Admin
Posts: 1236
Joined: Tue Jan 29, 2013 7:31 pm

Re: Critical Search Issue

Post by tuffadmin »

I have already made changes in development version related to search. It will be available when it gets released.
When we first implemented this thing it was working fine But in recent releases of osclass they made changes related to these thing which broke the functionality. It was already reported to me.
Regards
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: Critical Search Issue

Post by renas »

Can you please tell me what changes have been made?

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

Re: Critical Search Issue

Post by tuffadmin »

I have replaced $_GET globals with osclass inbuilt params method and category related issues.
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: Critical Search Issue

Post by renas »

It several files i suppose? Do you have a release date?
Locked