1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Seperate search

Discussion in 'Templates, HTML, CSS, and Design Help' started by BlackWebs, May 20, 2014.

  1. BlackWebs New Member

    Hi,

    Please could anyone advise whether it is possible to split the search function - selecting the Parent caregory in one drop down, then the child categories based on the parent in a second drop down.

    I've search all over for guides to do this, but can't find anything...

    Many thanks
    Tom
  2. Mike-N-Tosh Owner

    This would be quite a complicated endeavor to do which is probably why you can't find information regarding it. As there is no actual limit to how deep the category hierarchy can go, it would be quite a challenge just to have a template that would accommodate the levels of categories.

    Theoretically, you would do this with ajax. This would require that you have additional javascript written in the template file and/or loading a separate javascript file with the functions and ajax calls needed. A separate php file that would do the actual functions that are in the javascript calls (e.g. doing the mySQL queries in order to get each level of category based on the end user selection) then send that back to the javascript functions which would then in turn need to write that back into the template file within an already defined HTML element such as a "<div id="xxx">"... rinse and repeat for each level of category(ies) that you have while not interfering with the ajax/javascript that is already there to get extra fields, etc.. Then when the end user selects the final category, rename the form field to the name type in order to send to the searchresults.php processing file.

Share This Page