VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: simbus82 on April 11, 2012, 11:20:04 AM

Title: [fixed] VirtueMart Product Search 2.0.4 has never worked
Post by: simbus82 on April 11, 2012, 11:20:04 AM
Since my first VM 2.0.0 installation on Joomla! 2.5.x, VirtueMart Product Search Module has never worked.

If i do a search, it always answers me "no results found".

is it my fault? Have I configured something wrong?

Now i have VM 2.0.4 (with AIO 2.0.4) but the problem is still here.

Is it maybe related to the Joomla Search Plugin?

Have I to disable or enable something specific?

I have enabled all plugins related new joomla 2.5.4 search engine... but VirtueMart Product Search does not work if i have them turned off.
Title: Re: VirtueMart Product Search 2.0.4 has never worked
Post by: jjk on April 11, 2012, 11:38:55 AM
You will probably find an answer for your problem here:
http://forum.virtuemart.net/index.php?topic=95913.msg315126#msg315126 (http://forum.virtuemart.net/index.php?topic=95913.msg315126#msg315126)
Title: Re: VirtueMart Product Search 2.0.4 has never worked
Post by: simbus82 on April 11, 2012, 11:51:40 AM
Quote from: jjk on April 11, 2012, 11:38:55 AM
You will probably find an answer for your problem here:
http://forum.virtuemart.net/index.php?topic=95913.msg315126#msg315126 (http://forum.virtuemart.net/index.php?topic=95913.msg315126#msg315126)

VM search plugin is enabled (plugin don't need positioning -_-')
VM search module is enabled and well positioned in my template

Joomla Search module and Search Engine are ok when i want to use them.

I have not the problem of search result "under" the categories...
Title: Re: VirtueMart Product Search 2.0.4 has never worked
Post by: t.vdmeulen on April 11, 2012, 13:42:08 PM
I also have a problem with virtuemart search.

There is a product called: Heidelberg GTO52+ and when you search for Heidelberg nothing is shown.

But when you search for GTO it does show up. What is the problem and how can it be fixed?!

Thank you for any replies
Title: Re: VirtueMart Product Search 2.0.4 has never worked
Post by: Studio 42 on April 11, 2012, 18:59:46 PM
Hi,
DIfferent solution helpin most of time

-Try to add a Menu link in joomla main page.
-Deactive the SEF for you tests.
-look if the searched product have a category.
- look if you don't have select the category filter in the search module.
-look in BE config from vm2 if you have selected the right search fields(product name, short desc ..)
-renew config by file.

- Write here if all of this not work ;)

Title: Re: VirtueMart Product Search 2.0.4 has never worked
Post by: simbus82 on April 12, 2012, 01:34:29 AM
Quote from: Electrocity on April 11, 2012, 18:59:46 PM
-Try to add a Menu link in joomla main page.
Menu link... to? I have manually created a menu link (with a proper tree) for all categories.
Quote
-Deactive the SEF for you tests.
Nothing change
Quote-look if the searched product have a category.
All of my products are in a categery
Quote- look if you don't have select the category filter in the search module.
Nothing change
Quote-look in BE config from vm2 if you have selected the right search fields(product name, short desc ..)
All selected or none selected... or some selected, nothing change
Quote-renew config by file.
renew config file? umh... is it about to reset to default settings? It is a production site!

Quote- Write here if all of this not work ;)

I have uninstalled and then reinstalled AIO 2.0.4... nothing change!
Title: Re: VirtueMart Product Search 2.0.4 has never worked
Post by: ariplatinum on April 12, 2012, 08:12:13 AM
This may solve your problem. Ajax live search results, as the customer types in keywords. It works much better than the VM product search, which as you stated does not work.

It costs $15, but I got it to work seamlessly on my site. (VM 2.0.2, JM 2.5.4).

I am not affiliated with the product in anyway, just a happy customer.

http://extensions.joomla.org/extensions/extension-specific/virtuemart-extensions/virtuemart-products-search/17787

Title: Re: VirtueMart Product Search 2.0.4 has never worked
Post by: simbus82 on April 12, 2012, 11:07:46 AM
Quote from: ariplatinum on April 12, 2012, 08:12:13 AM
This may solve your problem. Ajax live search results, as the customer types in keywords. It works much better than the VM product search, which as you stated does not work.

Thanks for the info, but i want that this module work correctly!


I see this error with Joomla Debug ON (i have searched the word "brioso" with the module!)

JDatabaseMySQL::query: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'published`="1" AND (s.`virtuemart_shoppergroup_id`= "1" OR (s.`virtuemart_shopp' at line 4 SQL=SELECT SQL_CALC_FOUND_ROWS * FROM `j17_virtuemart_products_it_it` as l JOIN `j17_virtuemart_products` AS p using (`virtuemart_product_id`) LEFT JOIN `j17_virtuemart_product_categories` ON p.`virtuemart_product_id` = `j17_virtuemart_product_categories`.`virtuemart_product_id` LEFT JOIN `j17_virtuemart_categories_it_it` as c ON c.`virtuemart_category_id` = `j17_virtuemart_product_categories`.`virtuemart_category_id` LEFT JOIN `j17_virtuemart_product_manufacturers` ON p.`virtuemart_product_id` = `j17_virtuemart_product_manufacturers`.`virtuemart_product_id` LEFT JOIN `j17_virtuemart_manufacturers_it_it` as m ON m.`virtuemart_manufacturer_id` = `j17_virtuemart_product_manufacturers`.`virtuemart_manufacturer_id` LEFT JOIN `j17_virtuemart_product_shoppergroups` ON p.`virtuemart_product_id` = `j17_virtuemart_product_shoppergroups`.`virtuemart_product_id` LEFT OUTER JOIN `j17_virtuemart_shoppergroups` as s ON s.`virtuemart_shoppergroup_id` = `j17_virtuemart_product_shoppergroups`.`virtuemart_shoppergroup_id` WHERE (`product_name` LIKE "%brioso%" OR `product_sku` LIKE "%brioso%" OR `product_s_desc` LIKE "%brioso%" OR `product_desc` LIKE "%brioso%" OR `category_name` LIKE "%brioso%" OR `category_description` LIKE "%brioso%" OR `mf_name` LIKE "%brioso%" OR `p`.`virtuemart_product_id`` LIKE "%brioso%" AND p.`published`="1" AND (s.`virtuemart_shoppergroup_id`= "1" OR (s.`virtuemart_shoppergroup_id`) IS NULL )) group by p.`virtuemart_product_id` ORDER BY product_sku ASC LIMIT 0, 30


In red you see OR `p`.`virtuemart_product_id`` ... i'm wrong or i see too much single quotation marks?

And OR (s.`virtuemart_shopp'... i think it is truncated...

Here the call stack with the lines where the error occured

#   Function   Location
1   JSite->dispatch()   JROOT/index.php:42
2   JComponentHelper::renderComponent()   JROOT/includes/application.php:198
3   JComponentHelper::executeComponent()   JROOT/libraries/joomla/application/component/helper.php:357
4   require_once()   JROOT/libraries/joomla/application/component/helper.php:388
5   JController->execute()   JROOT/components/com_virtuemart/virtuemart.php:103
6   VirtueMartControllerCategory->display()   JROOT/libraries/joomla/application/component/controller.php:754
7   VirtuemartViewCategory->display()   JROOT/components/com_virtuemart/controllers/category.php:56
8   VirtueMartModelProduct->getProductsInCategory()   JROOT/components/com_virtuemart/views/category/view.html.php:138
9   VirtueMartModelProduct->sortSearchListQuery()   JROOT/administrator/components/com_virtuemart/models/product.php:779
10   VmModel->exeSortSearchListQuery()   JROOT/administrator/components/com_virtuemart/models/product.php:419
11   JDatabase->loadResultArray()   JROOT/administrator/components/com_virtuemart/helpers/vmmodel.php:366
12   JDatabase->loadColumn()   JROOT/libraries/joomla/database/database.php:1800
13   JDatabaseMySQL->query()   JROOT/libraries/joomla/database/database.php:936
14   JError::raiseError()   JROOT/libraries/joomla/database/database/mysql.php:542
15   JError::raise()   JROOT/libraries/joomla/error/error.php:251
Title: Re: VirtueMart Product Search 2.0.4 has never worked
Post by: simbus82 on April 12, 2012, 12:52:41 PM
Coulb be a part of the error?

Quote from: teobgeno on April 12, 2012, 12:35:54 PM
I tested the query you provide at your post and you are correct too much single quotation marks

at administrator/components/com_virtuemart/models/product.php

search for
$filter_search[] = '`'.$searchField.'` LIKE '.$keyword;

modify it to
$filter_search[] = '`'.$searchField.' LIKE '.$keyword;

and make  a test see if it is ok . Be cautious because there maybe conflicts elesewhere if it finally works.


I have edited the code but the search still not work :-(

You can try the search here (http://goo.gl/4wplb)
(is in the bottom of the left column)


Title: Re: VirtueMart Product Search 2.0.4 has never worked
Post by: teobgeno on April 12, 2012, 13:23:56 PM
The strange thing on this is that the query i echoed in my local site does not include the OR `p`.`virtuemart_product_id`` LIKE "%keyword%" 
I wonder why you have this output .Did you make any modifications to administrator/components/com_virtuemart/models/product.php ?
Title: Re: VirtueMart Product Search 2.0.4 has never worked
Post by: teobgeno on April 12, 2012, 13:35:18 PM
Try this and tell me if it is ok

search at administrator/components/com_virtuemart/models/product.php

for

$filter_search[] = '`'.$searchField.'` LIKE '.$keyword;

and replace with

if($searchField!='virtuemart_product_id')
{
    $filter_search[] = '`'.$searchField.'` LIKE '.$keyword;
}

If it is ok replace it back to its previous state . That is not the root of your problem something sending virtuemart_product_id as searchfield when it should not.
Title: Re: VirtueMart Product Search 2.0.4 has never worked
Post by: Milbo on April 12, 2012, 13:38:35 PM
I found the error, but I suggest not to make the search available for the product_ids

sry to say teo, your fix works only for one case imho, the error was one line above

$searchField = 'p`.`'.substr($searchField, 2, (strlen($searchField))) ;
Title: Re: VirtueMart Product Search 2.0.4 has never worked
Post by: teobgeno on April 12, 2012, 13:48:43 PM
Miss for 1 line . I was too close  :D

Nice work Milbo .
Title: Re: [fixed] VirtueMart Product Search 2.0.4 has never worked
Post by: simbus82 on April 12, 2012, 14:08:47 PM
Quote from: Milbo on April 12, 2012, 13:38:35 PM
I found the error, but I suggest not to make the search available for the product_ids

sry to say teo, your fix works only for one case imho, the error was one line above

$searchField = 'p`.`'.substr($searchField, 2, (strlen($searchField))) ;


YEAHHHHHHH!!! It works!

Thanks Milbo... and thank to you too teobgeno!!!

Title: Re: [fixed] VirtueMart Product Search 2.0.4 has never worked
Post by: achilleas on April 19, 2012, 12:43:42 PM
In VM 1 the search worked like this:
Lets' say we have a product named : "My best red product"
If you searched for "best product" you had 1 result the "My best red product"

In VM 2 if you make the same search "best product" you come up with No results. I tried "best + product" I tried "best AND product" but no luck at all. Is there any solution to this?

== EDIT ==
The search plugin works fine (like VM1)
The search module doesnt
Title: Re: [fixed] VirtueMart Product Search 2.0.4 has never worked
Post by: palpal on April 30, 2012, 10:59:23 AM
Hi all , thanks to raise the issue.

Thanks, Milbo !! once i disable the search for product_ids, it works very well now !!

Title: Re: [fixed] VirtueMart Product Search 2.0.4 has never worked
Post by: Milbo on May 31, 2012, 10:14:59 AM
The search plugin is a hook for the joomla plugin, while the module is pure vm.

Searches are an own field, like google proofes us every day.
Title: Re: [fixed] VirtueMart Product Search 2.0.4 has never worked
Post by: Sirinidis Nikolaos on August 21, 2012, 23:21:15 PM
I'd say that the answer is quite simple,
if you disable SEO then search module will work under all categories, but if you enable SEO search module will search the keyword in that particular category.
What I did to quick fix the problem was to add in <form> a new <input>

<input type="hidden" value="0" name="virtuemart_category_id">


and the other thing about "+" and "-" in product names..

you go to administrator/com_virtuemart/models/product.php
and around line 129 find

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

and replace it with

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

last parameter of uword is allowed characters
Title: Re: [fixed] VirtueMart Product Search 2.0.4 has never worked
Post by: bi4o4ek on August 31, 2012, 09:59:49 AM
i found solution for broken search here https://forum.virtuemart.net/index.php?topic=102965.0 (https://forum.virtuemart.net/index.php?topic=102965.0)
Title: Re: [fixed] VirtueMart Product Search 2.0.4 has never worked
Post by: SamTzu on September 04, 2012, 16:13:36 PM
None of these tips helped. The search is still broken on 2.0.10.
Title: Re: [fixed] VirtueMart Product Search 2.0.4 has never worked
Post by: ivowolfen on October 10, 2012, 15:20:04 PM
The problem for me was in the Joomla SEO - friendly addresses, not VM SEO. If this option is turned off everything with search is ok.

Added: The hack of ngoagr works fine /Joomla 2.5.7, VM 2.0.12b/, he missed to mention that hidden input is in the form in /modules/mod_virtuemart_search/tmpl/default.php and in the form in /components/com_virtuemart/views/category/tmpl/default.php . Works fine for me.
Title: Re: [fixed] VirtueMart Product Search 2.0.4 has never worked
Post by: walkyrie on November 26, 2012, 14:08:21 PM
thnak you, it works (but how can this be possible after one year of VM 2.0 ? ??  :o)
Title: Re: [fixed] VirtueMart Product Search 2.0.4 has never worked
Post by: Milbo on November 26, 2012, 21:10:03 PM
Both fixes are now added to the next 2.0.16 and 2.1

The search was not "broken" that is a bit too harsh word. Better said our security was too strict and not commode like google
Title: Re: [fixed-maybe] VirtueMart Product Search 2.0.4 has never worked
Post by: patrick356356 on December 29, 2012, 22:42:19 PM
Hi all,

I tried to copy the default.php under mod_virtuemart_search and category from VM2.0.16 to the corresponding override directories for VM2.0.14 but still I can't get all search results showing up when searching from inside a category. I only get the results from inside the open category.

I also tried to add the hidden fields in both these files as mentioned by ngoagr without any better result.

Can someone please tell how I should get Joomla SEO, VM SEO and the search to work as expected? Maybe it's clear from the previous post but I can't get it to work.

--------------------
Update
Took the risk and upgraded to 2.0.16 and it still only searches inside the opened category, not all categories. It doesn't matter if I check the "Category filter" in search module or not. Milbo, I thought you added the fix into 2.0.16 or did I misunderstand something?
-------------------

Thanks
Patrick
Title: Re: [fixed] VirtueMart Product Search 2.0.4 has never worked
Post by: Aliciah85 on January 25, 2013, 07:15:14 AM
Hi Patrick- did you end up getting a response? My search is also not working with SEO enabled and i am now on vm 2.0.18a...

thanks