Category search filter in vm search module doesn't work

Started by manuelgonzalez, April 23, 2012, 12:03:53 PM

Previous topic - Next topic

manuelgonzalez

I active the option "category search filter" (or something like that, i've vm in spanish, but search is in all products in shop, not only in current category. How can i fix then? I try to fix directly in vmsearch plugin but it seems that doesn't use it :S

Vm plugin search is activated and i've 2 vm search modules, one for global search and another inside the category.

lopezalejandro

Hi!
The problem is a little error on mysql querry composition.
in the file administrator/components/com_virtuemart/models/product.php in line 226
replace:
$where[] = implode(' OR ', $filter_search );
for:
$where[] = "(".implode(' OR ', $filter_search ).")";

bye, see you on monday at the office!

Alejandro López
Grupo Odín Soluciones Informáticas
http://grupoodin.es

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

PabloArias

#3
I have the opposite problem. When I disable the option "Search Filter Category" in module configuration, it continues filtering when you search being in a category or a product view.

I use Joomla 2.5.8, Virtuemart 2.0.18a and PHP 5.3.8. Tested too in PHP 5.3.6-13ubuntu3.2.

Thanks and regards!
Pablo Arias
www.pabloarias.eu

alepoudaki

I found that in order to work category search filter inside the Virtuemart Search Product module, in Global Configuration(Site tab) the Search Engine Friendly URLs must be enabled... I don't know if this is a bug.

PabloArias

Pablo Arias
www.pabloarias.eu

simplestudio

If the Search Engine Friendly URLs is enabled and "Search Filter Category" is disabled and the results continue to be filtered, then may by that will work for you:

Disable the Search Engine Friendly URLs in Global Configuration and then Enable it again
1. - Turn OFF the "Search Engine Friendly URLs" (in global configuration)
2. - Save settings
3. - and then turn them ON again
4. - Safe the settings again

It works for me.

Regards.

j0wnathan

Quote from: simplestudio on April 08, 2013, 16:08:04 PM
If the Search Engine Friendly URLs is enabled and "Search Filter Category" is disabled and the results continue to be filtered, then may by that will work for you:

Disable the Search Engine Friendly URLs in Global Configuration and then Enable it again
1. - Turn OFF the "Search Engine Friendly URLs" (in global configuration)
2. - Save settings
3. - and then turn them ON again
4. - Safe the settings again

It works for me.

Regards.

Wow, it worked. Thanks! :)

PabloArias

Pablo Arias
www.pabloarias.eu

simplestudio

#9
Quote from: PabloArias on April 09, 2013, 09:54:03 AM
It doesn't work for me.  :(

Thank you

Now fight with another problem.
Filtering works despite being OFF when the mainmenu contains a item with link to virtuemart category. When you remove that menu item from mainmenu, the search works correctly. When you put it again - the search begins to filter.

Anybody have a solution to this problem?
So far, it took me two weeks time and still no solution.

In my case the problem comes from the fact that I have the same product in two different categories. Once the product is a member of the category of the category "Models" (each model has a folder with the name of the model, which is the name of the model itself) and once a member of the category "Male" or "Female" respectively.
Hence, when I click on a model roads are confused, Tuck and accordingly there are two possible routes to the product, which is superimposed on the link.

simplestudio

Hi!
I found another little error on mysql querry composition.
in the file plugins/search/virtuemart/virtuemart.php in line 155

replace:
. ' WHERE ' . $where . ' AND p.published=1 '

with:
. ' WHERE (' . $where . ') AND p.published=1 '


All the "where" phrases must be enclosed in parentheses. Otherwise, all instructions after them are not running (ie everything from "AND" and bellow).

Regards,
Konstantin


csho

Quote from: simplestudio on April 08, 2013, 16:08:04 PM
If the Search Engine Friendly URLs is enabled and "Search Filter Category" is disabled and the results continue to be filtered, then may by that will work for you:

Disable the Search Engine Friendly URLs in Global Configuration and then Enable it again
1. - Turn OFF the "Search Engine Friendly URLs" (in global configuration)
2. - Save settings
3. - and then turn them ON again
4. - Safe the settings again

It works for me.

Regards.

*Bangs head repeatedly* Huge thanks, I so frustrated with all those silly bugs lately...