I am trying to include "Category" search in the Advanced search of my project. By going through some Stackoverflow questions, I realized that magento has built-in code for category search but they haven't used it.
I mean while searching if I add a param as
cat then that will represent Category. So, for example:
In the above url, the
cat param represents the id of Category. Hence, the search of string
shoe will be specific to the provided category id.
(ignore me if this is a known thing and a unnecessary explanation)
Now, what I am trying to do is split the search text in to two halves based on a colon(
:). such that the first part will be the "Category Name" and the second half will be the "Product Name" then I will append the
catalogsearch/result url this new params.
For example, if the search string provided by user is
Mobile:Blackberry, then I will extract the category Id from the provided category name and pass the query as follows:
I am not sure where exactly I should do this string manipulations.
Please guide me.