How to make Search filter to include sub category?

ClassiBase classifieds script Forums Tips and tricks How to make Search filter to include sub category?

This topic contains 10 replies, has 2 voices, and was last updated by  Elite Tan 2 years, 6 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1829 Reply

    Elite Tan
    Participant

    Support please see attached and advice?

    #1831 Reply

    Elite Tan
    Participant

    What file and code need to change to include sub category listing in search filter? Help….

    #1833 Reply

    Elite Tan
    Participant

    dear Support, or how to make the search filter like the chain menu such that we can filter by selecting type of Category, then follow by the Sub-Category will appear example, if I choose to filter Car, then Ferrari, Honda will appear in the search form, please let us know?

    #1834 Reply

    ClassiBase
    Keymaster

    It is possible to make category selection in search to list subcategories along with main categories. Making them chain select requires one more line of code. All these changes are direct customization to main script so you need to keep track of them and repeat if you update your script later.

    Please edit /sys/app/models/Widget.php file line 856 inside widgetSearch() method.

    Replace existing
    $return_custom .= '<p>' . Category::selectBox($selected_category->id, 'category_id', Category::STATUS_ENABLED, true, __('All categories'), 1) . '</p>';

    line with

    $return_custom .= '<p>' . Category::selectBox($selected_category->id, 'category_id', Category::STATUS_ENABLED, true, __('All categories')) . '</p>';
    $return_custom .= Category::selectBoxChain($selected_category->id, 'category_id', Category::STATUS_ENABLED, __('Select category'));

    lines. First line will generate select box with all subcategories, second line will generate chain select for javascript.

    #1849 Reply

    Elite Tan
    Participant

    thanks alot Support, i’m using version 1.5 i made above change but the dropbox now missing see below, please let me know what’s wrong? and how to fix it? this feature very important appreciate your help and advice…..

    #1851 Reply

    Elite Tan
    Participant

    Support from the existing code, I just remove the ,1 and is working now… if I copy and paste your 1st code cannot work, and as for the 2nd code chain menu filter still not working appreciate you can recheck the code and please let me know? urgent becos want to launch the site asap, Thanks alot and to hear from you again for the 2nd code………

    #1852 Reply

    Elite Tan
    Participant

    Support, I’m using $return and it works for the 1st code, your code earlier has $return_custom, and as for the 2nd code still no chain menu filter, appreciate you can advice on 2nd code…

    ————-1st code working using $return
    $return .= ‘<p>’ . Category::selectBox($selected_category->id, ‘category_id’, Category::STATUS_ENABLED, true, __(‘All categories’)) . ‘</p>’;

    ————2nd code not working

    #1853 Reply

    Elite Tan
    Participant

    dear Support, solved already i use below code, thanks alot for your wonderful support 🙂
    ——–
    $return .='<p>’
    . Category::selectBox($selected_category->id, ‘category_id’, Category::STATUS_ENABLED, true, __(‘Select category’), 0, true)
    . Category::selectBoxChain($selected_category->id, ‘category_id’, Category::STATUS_ENABLED, __(‘Select category’))
    . ‘</p>’;

    #1854 Reply

    Elite Tan
    Participant

    Support 1 more step further, after say we select Car -> Honda, how to make it such that all the searchable field in honda appear also? so that one can filter base on Car -> Honda -> price | age | mileage, etc? after selecting Car and Honda, want to make the searchable field for car appear also, what file and code to change?

    Please let us know?

    #1870 Reply

    ClassiBase
    Keymaster

    Unfortunately loading custom fields with ajax when selecting category on search form is not coded into the script.

    #1876 Reply

    Elite Tan
    Participant

    Support it’ll be super if you can include this to the to-do item for the next release, this will definitely bring classibase script to the next level to be on par with like http://www.mudah.my/Kedah/for-sale and please add to the to-do item for the next classibase release ok?

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: How to make Search filter to include sub category?
Your information: