VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: manuelgonzalez on April 23, 2012, 12:03:53 PM

Title: Category search filter in vm search module doesn't work
Post by: manuelgonzalez on April 23, 2012, 12:03:53 PM
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.
Title: Re: Category search filter in vm search module doesn't work
Post by: lopezalejandro on April 29, 2012, 13:12:47 PM
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!

Title: Re: Category search filter in vm search module doesn't work
Post by: Milbo on May 03, 2012, 11:17:22 AM
added, thanks.
Title: Re: Category search filter in vm search module doesn't work
Post by: PabloArias on February 04, 2013, 15:56:25 PM
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!
Title: Re: Category search filter in vm search module doesn't work
Post by: alepoudaki on February 06, 2013, 09:23:09 AM
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.
Title: Re: Category search filter in vm search module doesn't work
Post by: PabloArias on February 06, 2013, 12:54:41 PM
I have already Friendly URLs enabled.
Title: Re: Category search filter in vm search module doesn't work
Post by: 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.
Title: Re: Category search filter in vm search module doesn't work
Post by: j0wnathan on April 08, 2013, 17:43:04 PM
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! :)
Title: Re: Category search filter in vm search module doesn't work
Post by: PabloArias on April 09, 2013, 09:54:03 AM
It doesn't work for me.  :(

Thank you
Title: Re: Category search filter in vm search module doesn't work
Post by: simplestudio on April 09, 2013, 11:57:06 AM
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.
Title: Re: Category search filter in vm search module doesn't work
Post by: simplestudio on April 16, 2013, 12:53:25 PM
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
Title: Re: Category search filter in vm search module doesn't work
Post by: al_bel on February 13, 2014, 23:46:34 PM
Solution:
http://forum.virtuemart.net/index.php?topic=112741.msg395942#msg395942
Title: Re: Category search filter in vm search module doesn't work
Post by: csho on May 19, 2014, 13:31:04 PM
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...