VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: rippergr on April 24, 2012, 10:11:26 AM

Title: Virtuemart 2 search doesnt work.
Post by: rippergr on April 24, 2012, 10:11:26 AM
Hello all
I have a problem with virtuemart 2 search. When I search something it doesnt return any results even if I put the exact product name it just shows the categories. Only if I put the first word for example digi it gives me results. The website is http://comworldv2.comworld.gr .
Thanks in advance.

Joomla 2.5.2
Virtuemart 2.0.6

Title: Re: Virtuemart 2 search doesnt work.
Post by: plastique on April 24, 2012, 10:24:54 AM
I have also same issues with VM Search.
I can't understand why in search results shows on the top of the page the "Top level Categories" ?
Title: Re: Virtuemart 2 search doesnt work.
Post by: rippergr on April 24, 2012, 20:33:18 PM
Anyone who has a solution?
Title: Re: Virtuemart 2 search doesnt work.
Post by: rippergr on April 25, 2012, 10:45:31 AM
I think I am starting to realise what is the real problem. Today I was searching a product in virtuemart administrator and I had the same problem. Then I found that if I write only the number from a product for example 100 it shows all products that have this number but if I put a letter it doesnt return anything. So I am quessing that it has something to do with the languages.
Can someone give me a tip or a solution?
Title: Re: Virtuemart 2 search doesnt work.
Post by: rippergr on April 26, 2012, 10:37:27 AM
The problem is that virtuemart 2 doesnt allow special characters like -,.#$ etc for searching. I found this article as bug  http://forum.virtuemart.net/index.php?topic=97815.0 but I don't see any solution or change in virtuemart search.
The only solution I found is here http://forum.virtuemart.net/index.php?topic=98524.msg332819#msg332819
Title: Re: Virtuemart 2 search doesnt work.
Post by: rippergr on May 07, 2012, 19:16:39 PM
I found a solution for this problem. I changed the file config.php in /administrator/components/com_virtuemart/helpers/
in line 812


return mb_ereg_replace('[^\w'.preg_quote($custom).']', '', $source);

to

return mb_ereg_replace('/[^\w'.preg_quote($custom).']/', '', $source);

The problem is that virtuemart search filter all special characters and returns no results.
With this tweak it working great.
I don't know if there is any problem with security issues. Use it with your own responsibility
Title: Re: Virtuemart 2 search doesnt work.
Post by: 552288 on May 16, 2012, 20:27:16 PM
it´s an security risk or not............
Everybody knows the answer?

Greetz Ray  :o
Title: Re: Virtuemart 2 search doesnt work.
Post by: rippergr on June 12, 2012, 11:37:56 AM
I don't think that is security issue if virtuemart let "-" for searching
I agree that characters like ><&% are dangerous but I don't remember "-" character can open a hole in security.
Title: Re: Virtuemart 2 search doesnt work.
Post by: Sirinidis Nikolaos on August 21, 2012, 23:06:32 PM
you don't have to change anything in config.php
just open administrator/com_virtuemat/models/products.php
and find around line 129

$this->keyword = vmRequest::uword ('keyword', "0", ' ');

the last parameter of uword is allowed characters when filtering keyword, now it has the space character you just add "-" character


$this->keyword = vmRequest::uword ('keyword', "0", ' ,-');
Title: Re: Virtuemart 2 search doesnt work.
Post by: Ean on August 22, 2012, 14:10:36 PM
None of the fixes above have worked for me.

Are there plans for this to be fixed via a release rather than hacking?
Title: Re: Virtuemart 2 search doesnt work.
Post by: bi4o4ek on August 31, 2012, 10:03:34 AM
good solution for broken search in wirtuemart 2 https://forum.virtuemart.net/index.php?topic=102965.0 (https://forum.virtuemart.net/index.php?topic=102965.0)