VirtueMart Forum

VirtueMart 2 + 3 + 4 => Frontend Modules => Topic started by: sgs on May 12, 2015, 16:17:38 PM

Title: change search query
Post by: sgs on May 12, 2015, 16:17:38 PM
Hi! I'm using virtuemart 3.0.8.
I would like to know where is the file where I can change the query of search module.
Do you know what is / are the file/files?

Thank you!
Title: Re: change search query
Post by: PRO on May 12, 2015, 19:21:32 PM
what are you trying to do?
Title: Re: change search query
Post by: sgs on May 13, 2015, 09:49:48 AM
I've a category that i've called "Motors". In this category i've a product that i've called "motore volvo".

Now: if i search with "motore volvo" , I found it. But if i wrote "volvo motore" i don't find it. I would like that the search query would be with "like" and not equal...

Hope that i'm clear  :D
Title: Re: change search query
Post by: GJC Web Design on May 13, 2015, 10:23:03 AM
the queries are in the admin->models-> product.php
Title: Re: change search query
Post by: sgs on May 13, 2015, 19:09:33 PM
Thanks for the reply..
But what is the query that virtuemart executes with the search module?
Title: Re: change search query
Post by: GJC Web Design on May 14, 2015, 23:49:34 PM
can't remember the exact function name but it is very obvious in that file - + extremely complex
Title: Re: change search query
Post by: balai on May 15, 2015, 10:32:55 AM
The query is generated in the file: administrator/components/com_virtuemart/models/product.php
function sortSearchListQuery

Btw. This functionality exists in the Custom Filters PRO extension, if want to use a 3rd party for search
https://breakdesigns.net/extensions/custom-filters