Jump to content

[Solved] How to make front office search return multiple categories?


Muller

Recommended Posts

Hello,<br/><br/>I have an idea to create a module for the left column that will display all categories and sub categories and place check boxes by every sub category. The idea is that every time a check box is selected, I check which check boxes are selected and create a string out of that, and send that string to the search module.<br/><br/>Basically I want to re-use code in the search module.<br/><br/>However, I can't get the default search to do what I want. In the default theme, if I search "ipod laptops" it doesn't return anything. I want that search query to return ALL ipods and laptops.<br/><br/>Is there a search query that will do that?<br/>Also, is my idea for the module good?<br/><br/>Thanks.

Link to comment
Share on other sites

It's so simple

this can be achieve with the help of jquery
first of list category and subcategory with the check box you can easily get value of checked category

and redirect to url
search.php?orderway=desc&search_query=ipod

If you still found problem in creating module then explain me which type of search query you want to create on check box clicked . So that I can help in better way

Link to comment
Share on other sites

My only problem is getting the right search query that will display all products in two different categories.

For example: What is the search query that will display all products in "ipods" and in "laptops"? I want to see all ipods AND laptops.

I can test the query in the regular search box, I just need to know the correct query string :)

Link to comment
Share on other sites

Hi Muller

I have made a small changes in classes/Search.php file, attached below

Now
Query string should be like
this
/search.php?orderby=position&orderway=desc&search_query=laptop,neeraj&submit_search=Search

&search_query=laptop,ipod
&search_query=laptop and ipod
&search_query=laptop&ipod;&search_query=laptop+ipod
&search_query=laptop ipod
&search_query=laptop ipod
&search_query=laptop
&search_query=MacBook

search.txt

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...