News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

[fixed] VirtueMart Product Search 2.0.4 has never worked

Started by simbus82, April 11, 2012, 11:20:04 AM

Previous topic - Next topic

simbus82

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.
Joomla! 2.5.16 & VM 2.0.24b

jjk

Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

simbus82

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

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...
Joomla! 2.5.16 & VM 2.0.24b

t.vdmeulen

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

Studio 42

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 ;)


simbus82

#5
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!
Joomla! 2.5.16 & VM 2.0.24b

ariplatinum

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

Joomla 2.5.4
Virtuemart 2.0.4
Firefox 11

simbus82

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
Joomla! 2.5.16 & VM 2.0.24b

simbus82

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
(is in the bottom of the left column)


Joomla! 2.5.16 & VM 2.0.24b

teobgeno

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 ?

teobgeno

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.

Milbo

#11
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))) ;
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

teobgeno

Miss for 1 line . I was too close  :D

Nice work Milbo .

simbus82

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!!!

Joomla! 2.5.16 & VM 2.0.24b

achilleas

#14
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