Author Topic: [fixed] VirtueMart Product Search 2.0.4 has never worked  (Read 16907 times)

simbus82

  • Jr. Member
  • **
  • Posts: 109
    • Simbus82 Web & Tech
[fixed] VirtueMart Product Search 2.0.4 has never worked
« 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.
Joomla! 2.5.16 & VM 2.0.24b

jjk

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3487
  • using Matomo instead of Google Analytics
Re: VirtueMart Product Search 2.0.4 has never worked
« Reply #1 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
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

simbus82

  • Jr. Member
  • **
  • Posts: 109
    • Simbus82 Web & Tech
Re: VirtueMart Product Search 2.0.4 has never worked
« Reply #2 on: April 11, 2012, 11:51:40 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

  • Contributing Developer
  • Beginner
  • *
  • Posts: 7
Re: VirtueMart Product Search 2.0.4 has never worked
« Reply #3 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

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3959
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: VirtueMart Product Search 2.0.4 has never worked
« Reply #4 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 ;)


simbus82

  • Jr. Member
  • **
  • Posts: 109
    • Simbus82 Web & Tech
Re: VirtueMart Product Search 2.0.4 has never worked
« Reply #5 on: April 12, 2012, 01:34:29 am »
-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

  • Beginner
  • *
  • Posts: 8
Re: VirtueMart Product Search 2.0.4 has never worked
« Reply #6 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

Joomla 2.5.4
Virtuemart 2.0.4
Firefox 11

simbus82

  • Jr. Member
  • **
  • Posts: 109
    • Simbus82 Web & Tech
Re: VirtueMart Product Search 2.0.4 has never worked
« Reply #7 on: April 12, 2012, 11:07:46 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

  • Jr. Member
  • **
  • Posts: 109
    • Simbus82 Web & Tech
Re: VirtueMart Product Search 2.0.4 has never worked
« Reply #8 on: April 12, 2012, 12:52:41 pm »
Coulb be a part of the error?

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

  • Jr. Member
  • **
  • Posts: 55
    • www.netpin.gr
Re: VirtueMart Product Search 2.0.4 has never worked
« Reply #9 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 ?

teobgeno

  • Jr. Member
  • **
  • Posts: 55
    • www.netpin.gr
Re: VirtueMart Product Search 2.0.4 has never worked
« Reply #10 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.

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9856
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: VirtueMart Product Search 2.0.4 has never worked
« Reply #11 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
Code: [Select]
$searchField = 'p`.`'.substr($searchField, 2, (strlen($searchField))) ;
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

teobgeno

  • Jr. Member
  • **
  • Posts: 55
    • www.netpin.gr
Re: VirtueMart Product Search 2.0.4 has never worked
« Reply #12 on: April 12, 2012, 13:48:43 pm »
Miss for 1 line . I was too close  :D

Nice work Milbo .

simbus82

  • Jr. Member
  • **
  • Posts: 109
    • Simbus82 Web & Tech
Re: [fixed] VirtueMart Product Search 2.0.4 has never worked
« Reply #13 on: April 12, 2012, 14:08:47 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
Code: [Select]
$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

  • Beginner
  • *
  • Posts: 22
Re: [fixed] VirtueMart Product Search 2.0.4 has never worked
« Reply #14 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