VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Frontend Modules VM 1.1 => Topic started by: iskye81 on November 17, 2009, 15:46:29 pm

Title: VirtueMart search not searching on categories
Post by: iskye81 on November 17, 2009, 15:46:29 pm
Wonder if anyone can help out with this.  I have the virtuemart search module enabled on my site, and according to the plugin parameters search on category names is enabled.  But searching on a specific category name is returning NO results - the only results I get are if a category name happens to be mentioned within a product name, description etc.

The search works fine on other enabled items - product names, SKUs, short/long descriptions etc, but not on categories.  Anyone have any ideas?  ???
Title: Re: VirtueMart search not searching on categories
Post by: iskye81 on November 18, 2009, 17:52:11 pm
Anyone??
Title: Re: VirtueMart search not searching on categories
Post by: baljit on November 24, 2009, 12:13:31 pm
Hello

Same problem here.Got solution????

Thanks
Title: Re: VirtueMart search not searching on categories
Post by: skylo on January 12, 2010, 18:02:10 pm
Bumping this one in case anyone has any idea i can search fine on categories but not on products which is important  even if I type in an exact match it returns nothing any ideas anyone please.

Skylo
Title: Re: VirtueMart search not searching on categories
Post by: highdt on March 19, 2010, 16:03:14 pm
Hi, I'm also trying to find a solution to the same issue that iskye81 is experiencing.  The Virtuemart search module is not searching the category paths for my products :(  Any advice on how to fix this?  Thanks
Title: Re: VirtueMart search not searching on categories
Post by: snozim on November 23, 2010, 01:41:07 am
same problem here!!! plz help!
Title: Re: VirtueMart search not searching on categories
Post by: seyi on November 23, 2010, 02:17:59 am
The search virtuemart plugin only works with the normal search (mod_search) not with virtuemart search (mod_virtuemart_search).  The functionality is easy to add though directly into the code.

In www/administrator/components/com_virtuemart/html/shop_browse_queries.php, around line 102 is this line
Code: [Select]
<?php
$sq 
.= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%') ";
?>

Right before that line, add this:
Code: [Select]
<?php
$sq 
.= "\n `#__{vm}_category`.`category_name` LIKE '%$searchstring%' OR ";
?>

Now, by default, the category name is also searched along with the product name/description.
Title: Re: VirtueMart search not searching on categories
Post by: knibal on January 21, 2011, 14:41:29 pm
Hi,

Joomla 1.5.22 and VM 1.1.6

I´m having the same problem. I have a 1st level categorie called "Calculators" and inside it, different models of calculators, for example, calculator 1, calculator 2, etc.

So, when the user searchs for "calculator", it shows the hole items with "calculator" in title or description.

But if they search "calculators", the system does not regret any result.

So, the problem is that the VM search module doesn´t search on categories.

I have tried the code modification up there but doesn´t work.

In www/administrator/components/com_virtuemart/html/shop_browse_queries.php

i find this code:

Code: [Select]
// This is the "normal" search
if( !empty($keywordArr) ) {
$sq = "(";
$numKeywords = count( $keywordArr );
$i = 1;
foreach( $keywordArr as $searchstring ) {
$sq .= "\n (`#__{vm}_product`.`product_name` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_sku` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_s_desc` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%') ";

if( $i++ < $numKeywords ) {
$sq .= "\n  AND ";
}
}
$sq .= ")";
$where_clause[] = $sq;
}

and replaced for this:

Code: [Select]
// This is the "normal" search
if( !empty($keywordArr) ) {
$sq = "(";
$numKeywords = count( $keywordArr );
$i = 1;
foreach( $keywordArr as $searchstring ) {
$sq .= "\n (`#__{vm}_product`.`product_name` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_sku` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_s_desc` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_category`.`category_name` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%') ";

if( $i++ < $numKeywords ) {
$sq .= "\n  AND ";
}
}
$sq .= ")";
$where_clause[] = $sq;
}

but still doesn´t work, any idea on how to fix this? Any other module or extension to fix this problem?
Title: Re: VirtueMart search not searching on categories
Post by: knibal on January 22, 2011, 15:43:29 pm
Hi! Any help please? :(
Title: Re: VirtueMart search not searching on categories
Post by: seyi on January 22, 2011, 16:55:57 pm
Hmm, I do not see any problems with your query.  Are you 100% sure it is using vm search?  Put an exit statement in there somewhere (after backing up your stuff) and then search again.  If the page shows up fully, then its not calling that query.
Title: Re: VirtueMart search not searching on categories
Post by: knibal on January 25, 2011, 17:14:09 pm
Hi seyi, thnks for answering, I´m not an advanced programmer so I don´t know exactly what to do.

I´m sure I´m using vm_search but don´t get any results when searching for a category name.

As far as I know, vm_search allows to search on SKU, title, short desc., long desc.

So if I search a category title, it gives me nothing. I would expect to give me either a category to enter in or all the products under that category, but as I said, I get no search results :\
Title: Re: VirtueMart search not searching on categories
Post by: Keddy Logern on January 25, 2011, 19:45:42 pm


You have to use the VirtueMart Search Module, but not the default Joomla search.
In Short make sure you have published VM Search Module- ( but this searches only VM - not other site contents or articles)
Title: Re: VirtueMart search not searching on categories
Post by: kal-el on June 26, 2011, 16:00:46 pm
Thank you, Seyi. You saved me from a lot of searching, digging through code, and stress. You da man!
Title: Re: VirtueMart 2.0.12 search not searching on categories
Post by: tobias_conrad on October 05, 2012, 18:48:57 pm
hi i have still this problem.
i have a lot of important content inside the category and it is not searchable!

who knows a solution?
Title: Re: VirtueMart search not searching on categories
Post by: danyz on January 23, 2013, 17:01:22 pm
Hello, I know this thread is old but I'm having the same issue here. I want to search for VM categories and not products. Is there a way to do that? Thank you very much
Title: Re: VirtueMart search not searching on categories
Post by: danyz on January 24, 2013, 16:43:40 pm
Ok, I finally managed to resolve this problem using this free search component:

http://www.rsjoomla.com/free-downloads/download.html?path=com_rssearch%2FComponent%2Fcom_rssearch.zip