Jump to content

How to create a custom search with filters


Recommended Posts

Hi guys, I am trying to develop a custom search module (my first one) that allows me to filter categories, manifacturer and features to search some products. I started building a form in the homepage but here the questions begin. Is it right to send collected data to the search page?

 

I tryed with

<form action="{$link->getPageLink('search', true)|escape:'html'}" method="get">

using the search controller but i can't understand how the research use datas from the form. Indeed the search find nothing.

 

Should I use a custom controller too?

 

I tryed to see how blocklayered module works (cause it is similar to what i need to do) with very poor results.

 

Let me know if someone can help me.

Link to comment
Share on other sites

First of all you haven't mentionned your prestashop version.

Second: search might do the job but in a very limited manner. Because search uses all keywords and combines them with an OR condition. So if you throw this keywords

 

iphone black

 

into the search controller, you will get back all products containing iPhone or black.

 

And the last thing: if you are struggling with the basics on how to use a controller, programming a search filter might get difficult.

Link to comment
Share on other sites

I have 1.6.1.11 Prestashop version installed.

If I understand what you said I have to use a custom controller. The question is: how? I checked prestashop developer documentation but it is very poor. Can you suggest me something to start?

Link to comment
Share on other sites

I suggest to use the facated filter, also called layered navigation. To write an own module as beginner which can handle more than the default module would take quite much time (weeks, not days).

 

Even explaining the "how to write an own controller" would lead to write many pages here.

Link to comment
Share on other sites

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...