VirtueMart Forum
VirtueMart 1.1.x [ Old version - no longer supported ] => Translation / Languages VM 1.1 => Topic started by: Forsh on September 19, 2006, 13:55:04 pm
-
I have an Virtuemart installed in "English" and am translating content into "Japanese".
However...I just tested a search....typing "English" works fine...
The "Japanese" search yeilds no search results. Does anyone have any type of hack/tweak/alteration to fix this issue? Multilingual Virtuemart is nice, but so very limited if search functions in different languages won't work.
Any advice would be greatly appreciated.
-
Hello Forsh,
I am stuck at the same point you asked. I suppose a lot of vm users would thanks to you if you share your solution with us.
Thanks
Sprogo
-
Oh, you may have misunderstood me... :)
I am not able to search in "japanese", only English.
I am looking for a solution also. Having Joomfish with Virtuemart is great, but if customers can not search in their own language it's a moot point unless you only let them browse.
-
Ooppss sorry, I thought you would have more chance than me finding a solution as a month passed since then.
Anyway, if anybody find a way let us share it here.
Thanjs
-
I do run Virtuemart 1.0.5, is this something that may have been fixed in the newer 1.0.7?
If someone using 1.0.7 can, see if you are able to add 出張撮影 to your store and then conduct a search through VM and see if it shows results.....
-
Not sure myself but also looking for an answer. Anyone know if this is a recognized bug in the product or if there is a fix?
-
I use Vm 1.07 and Joomfish and the problem is the same.
I dont think it's a bug. I blelieve that VM search module doesn't matter Joomfish translations.
I need this feature because my site is multilingual so i m working on a solution but it seems to be a complex thing to do.
I will post my result later.
-
Thanks for the reply Yves.
Good luck with finding a solution. I have recently started looking at OsCommerce and they do not have that problem. I have been testing a few sites and multilingual searches work fine.
Type Hund in German when surfing the site in German and the right products pop up.
Type Dog in English when surfing the site in English and the same products pop up - but in English now.
Never do you get no products found ;D
-
I used OsCommerce one year before but i stopped.
It was very difficult to make some changes because to many part were developped in different ways and there was no real core functions everybody used.
When I looked at Joomla, it was a very different thing, and it's easier to make some hack and improvement to fit my customers wishes.
However, VM line codes are a bit more difficult to handle (sorry Soeren :) ) because VM php programs are very long and contains many conditionnal statement.
But in any case, i will never come back to OScommerce.
-
ah good to know. I will keep that in mind. Hopefully soon you can figure a way of fixing the multi-language bug and then Virtumart will be the way to go. I just wish I could do hacks and understand code LOL
-
I made this hack to VM.
It allows search in any language, i.e whatever the language selected, it searchs in ALL languages (if the translation is published).
First, i tried to make a search only in the selected language but it's very complex due to the default language feature (which is a significant difference with OScommerce).
But, on second thought, it appeared a good idea to allows customers to find products without take care of language.
It works with module 'mod_virtuemart_search.php' or 'mod_virtuemart.php' and also component page 'shop.search'
I modified a VM page so if you install a new version of VM, all changes will be lost.
There must remains some bugs, so if you can test it and feed back, it wil help me.
This file is \administrator\components\com_virtuemart\html\shop_browse_queries.php
@++
[attachment cleanup by admin]
-
I will install it this weekend and start working on it. I will give you feedback during the next week and see how it runs.
Thanks for the info and i am glad to help.
Cheers
-
Hi!
I've tested the shop_browse_queries.php Hack from Yves.
On my lokal Server it run's very well.
PHP Version 5.0.5
MySQL 4.1.11
But unfortunately not on the target server:
PHP Version 4.4.4
MySQL 4.0.27
Is there another Version? Or perhaps another solution to the problem of Searching in multiple languages?
Thanks a lot!
-
The problem comes from your Mysql server version which can not handle the new query : it includes a nested SELECT sub-query instruction which is not support by Mysql 4.0.
If you can upgrade it to a newer version, it will be ok.
Some hostings (as 1&1) let you choose your Mysql version.
Solutions to avoid that problem are too complex and the best is to change your mysql server.
-
Hi Yves!
Thank's a lot! It runs very well!
-
I am not able to download the file... :'( :'(
Tried it with I.E. and Mozilla.
Could anybody please send this file to me. I realy need this extra search functionality
Thanks in advance.
Demandred
-
I can send it to you but how ?
Can you PM me you email address ?
@+
-
I PM-ed you my address..
Thnx for the fast reply.
If this is going to work for me too I owe you big time!!!
I will let you know the results.
Thnx again
-
SWEET!!!!
It works like a charm.
Thank you so much for this great VM hack.
*bow*
-
It seems that the link doesn't work so here's the full code
Be carefull this is a hack, not a searchbot !
shop_browse_queries.php
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
/* The original file had been changed because
* some parts contains some hack by Yves
* This file is to be included from the file shop.browse.php
* and uses variables from the environment of the file shop.browse.php
*
* @version $Id: shop_browse_queries.php,v 1.6.2.4 2006/04/23 19:40:07 soeren_nb Exp $
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2005 Soeren Eberhardt. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName( __FILE__ );
/** Prepare the SQL Queries
*
*/
// These are the names of all fields we fetch data from
$fieldnames = "`product_name`,`products_per_row`,`category_browsepage`,`category_flypage`,`#__{vm}_product`.`product_id`,`#__{vm}_category`.`category_id`,`product_full_image`,`product_thumb_image`,`product_s_desc`,`product_parent_id`,`product_publish`,`product_in_stock`,`product_sku`";
$count_name = "COUNT(DISTINCT `#__{vm}_product`.`product_sku`) as num_rows";
switch( $orderby ) {
case 'product_name':
$orderbyField = '`#__{vm}_product`.`product_name`'; break;
case 'product_price':
$orderbyField = '`#__{vm}_product_price`.`product_price`'; break;
case 'product_sku':
$orderbyField = '`#__{vm}_product`.`product_sku`'; break;
case 'product_cdate':
$orderbyField = '`#__{vm}_product`.`cdate`'; break;
default:
$orderbyField = '`#__{vm}_product`.`product_name`'; break;
}
/** Changed Product Type - Begin */
if (!empty($product_type_id)) {
require_once (CLASSPATH."ps_product_type.php");
$ps_product_type = new ps_product_type();
// list parameters:
$q = "SELECT `parameter_name`, `parameter_type` FROM `#__{vm}_product_type_parameter` WHERE `product_type_id`='$product_type_id'";
$db_browse->query($q);
/*** GET ALL PUBLISHED PRODUCT WHICH MATCH PARAMETERS ***/
$list = "SELECT DISTINCT $fieldnames FROM (`#__{vm}_product`, `#__{vm}_category`, `#__{vm}_product_category_xref`,`#__{vm}_shopper_group`) ";
$count = "SELECT $count_name FROM (`#__{vm}_product`, `#__{vm}_category`, `#__{vm}_product_category_xref`,`#__{vm}_shopper_group`) ";
$q = "LEFT JOIN `#__{vm}_product_price` ON `#__{vm}_product`.`product_id` = `#__{vm}_product_price`.`product_id` ";
$q .= "\n \n LEFT JOIN `#__{vm}_product_type_$product_type_id` ON `#__{vm}_product`.`product_id` = `#__{vm}_product_type_$product_type_id`.`product_id` ";
$q .= "\n LEFT JOIN `#__{vm}_product_product_type_xref` ON `#__{vm}_product`.`product_id` = `#__{vm}_product_product_type_xref`.`product_id` ";
$q .= "\n WHERE `#__{vm}_product_category_xref`.`category_id`=`#__{vm}_category`.`category_id` ";
// $q .= "\n AND `#__{vm}_product`.`product_id`=`#__{vm}_product_category_xref`.`product_id` ";
// $q .= "\n AND `#__{vm}_product`.`product_parent_id`='0' ";
$q .= "\n AND (`#__{vm}_product`.`product_id`=`#__{vm}_product_category_xref`.`product_id` ";
$q .= "\n OR `#__{vm}_product`.`product_parent_id`=`#__{vm}_product_category_xref`.`product_id`)";
if( !$perm->check("admin,storeadmin") ) {
$q .= "\n AND `product_publish`='Y'";
if( CHECK_STOCK && PSHOP_SHOW_OUT_OF_STOCK_PRODUCTS != "1") {
$q .= "\n AND `product_in_stock` > 0 ";
}
}
$q .= "\n AND `#__{vm}_product_product_type_xref`.`product_type_id`=$product_type_id ";
// find by parameters
while ($db_browse->next_record()) {
$parameter_name = $db_browse->f("parameter_name");
$item_name = "product_type_$product_type_id"."_".$parameter_name;
$get_item_value = mosgetparam($_REQUEST, $item_name, "");
$get_item_value_comp = mosgetparam($_REQUEST, $item_name."_comp", "");
if (is_array($get_item_value) ? count($get_item_value) : strlen($get_item_value) ) {
// comparison
switch ($get_item_value_comp) {
case "lt": $comp = " < "; break;
case "le": $comp = " <= "; break;
case "eq": $comp = " <=> "; break;
case "ge": $comp = " >= "; break;
case "gt": $comp = " > "; break;
case "ne": $comp = " <> "; break;
case "texteq":
$comp = " <=> ";
break;
case "like":
$comp = " LIKE ";
$get_item_value = "%".$get_item_value."%";
break;
case "notlike":
$comp = "COALESCE(`".$parameter_name."` NOT LIKE '%".$get_item_value."%',1)";
$parameter_name = "";
$get_item_value = "";
break;
case "in": // Multiple section List of values
$comp = " IN ('".join("','",$get_item_value)."')";
$get_item_value = "";
break;
case "fulltext":
$comp = "MATCH (`".$parameter_name."`) AGAINST ";
$parameter_name = "";
$get_item_value = "('".$get_item_value."')";
break;
case "find_in_set":
$comp = "FIND_IN_SET('$get_item_value',`$parameter_name`)";
$parameter_name = "";
$get_item_value = "";
break;
case "find_in_set_all":
case "find_in_set_any":
$comp = array();
foreach($get_item_value as $value) {
array_push($comp,"FIND_IN_SET('$value',`$parameter_name`)");
}
$comp = "(" . join($get_item_value_comp == "find_in_set_all"?" AND ":" OR ", $comp) . ")";
$parameter_name = "";
$get_item_value = "";
break;
}
switch ($db_browse->f("parameter_type")) {
case "D": $get_item_value = "CAST('".$get_item_value."' AS DATETIME)"; break;
case "A": $get_item_value = "CAST('".$get_item_value."' AS DATE)"; break;
case "M": $get_item_value = "CAST('".$get_item_value."' AS TIME)"; break;
case "C": $get_item_value = "'".substr($get_item_value,0,1)."'"; break;
default:
if( strlen($get_item_value) ) $get_item_value = "'".$get_item_value."'";
}
if( !empty($parameter_name) ) $parameter_name = "`".$parameter_name."`";
$q .= "\n AND ".$parameter_name.$comp.$get_item_value." ";
}
}
$item_name = "price";
$get_item_value = mosgetparam($_REQUEST, $item_name, "");
$get_item_value_comp = mosgetparam($_REQUEST, $item_name."_comp", "");
// search by price
if (!empty($get_item_value)) {
// comparison
switch ($get_item_value_comp) {
case "lt": $comp = " < "; break;
case "le": $comp = " <= "; break;
case "eq": $comp = " = "; break;
case "ge": $comp = " >= "; break;
case "gt": $comp = " > "; break;
case "ne": $comp = " <> "; break;
}
$q .= "\n AND ( ISNULL(product_price) OR product_price".$comp.$get_item_value." ) ";
$auth = $_SESSION['auth'];
// get Shopper Group
$q .= "\n AND ( ISNULL(`#__{vm}_product_price`.`shopper_group_id`) OR `#__{vm}_product_price`.`shopper_group_id` IN (";
$comma="";
if ($auth["user_id"] != 0) { // find user's Shopper Group
$q2 = "SELECT `shopper_group_id` FROM `#__{vm}_shopper_vendor_xref` WHERE `user_id`='".$auth["user_id"]."'";
$db_browse->query($q2);
while ($db_browse->next_record()) {
$q .= $comma.$db_browse->f("shopper_group_id");
$comma=",";
}
}
// find default Shopper Groups
$q2 = "SELECT `shopper_group_id` FROM `#__{vm}_shopper_group` WHERE `default` = 1";
$db_browse->query($q2);
while ($db_browse->next_record()) {
$q .= $comma.$db_browse->f("shopper_group_id");
$comma=",";
}
$q .= "\n )) ";
}
$q .= "\n GROUP BY `#__{vm}_product`.`product_sku` ";
$count .= $q;
$q .= "\n ORDER BY $orderbyField ".$DescOrderBy;
$list .= $q . " LIMIT $limitstart, " . $limit;
// $error = $list; // only for debug
}
/** Changed Product Type - End */
elseif (empty($manufacturer_id)) {
/*** GET ALL PUBLISHED PRODUCTS ***/
$list = "SELECT DISTINCT $fieldnames FROM (`#__{vm}_product`, `#__{vm}_category`, `#__{vm}_product_category_xref`,`#__{vm}_shopper_group`) ";
$count = "SELECT $count_name FROM (`#__{vm}_product`, `#__{vm}_category`, `#__{vm}_product_category_xref`,`#__{vm}_shopper_group`) ";
$q = "LEFT JOIN `#__{vm}_product_price` ON `#__{vm}_product`.`product_id` = `#__{vm}_product_price`.`product_id` ";
// hack yves - aude line
$t = array();
if (!empty($keyword)) $t[] = " `value` LIKE '%$keyword%'";
if (!empty($keyword1)) $t[] = " `value` LIKE '%$keyword1%'";
if (!empty($keyword2)) $t[] = " `value` LIKE '%$keyword2%'";
if (count($t)){
$q .= "LEFT JOIN ( SELECT `reference_field` , `reference_id` , `value` FROM `#__jf_content`";
$q .= " WHERE `reference_table` = 'vm_product' AND `published` = 1 " ;
$q .= " AND ( " . implode(" OR ", $t) . " ) ";
$q .= ") AS trad ON `jos_vm_product`.`product_id` = `trad`.`reference_id`";
}
// end hack yves - aude line
$q .= "\n WHERE `#__{vm}_product_category_xref`.`category_id`=`#__{vm}_category`.`category_id` ";
if( $category_id ) {
$q .= "\n AND `#__{vm}_product_category_xref`.`category_id`='".$category_id."' ";
}
$q .= "\n AND `#__{vm}_product`.`product_id`=`#__{vm}_product_category_xref`.`product_id` ";
$q .= "\n AND `#__{vm}_product`.`product_parent_id`='0' ";
if( !$perm->check("admin,storeadmin") ) {
$q .= "\n AND `product_publish`='Y'";
if( CHECK_STOCK && PSHOP_SHOW_OUT_OF_STOCK_PRODUCTS != "1") {
$q .= "\n AND `product_in_stock` > 0 ";
}
}
$q .= "\n AND ((";
if ($auth["shopper_group_id"] > 0) {
$q .= "\n `#__{vm}_shopper_group`.`shopper_group_id`=`#__{vm}_product_price`.`shopper_group_id` ";
//$q .= "\n AND `#__{vm}_shopper_group`.`shopper_group_id`='".$auth["`shopper_group_id`"]."'";
}
else {
$q .= "\n `#__{vm}_shopper_group`.`shopper_group_id`=`#__{vm}_product_price`.`shopper_group_id` ";
//$q .= "\n AND `#__{vm}_shopper_group`.default = '1' ";
}
$q .= "\n ) OR (`#__{vm}_product_price`.`product_id` IS NULL)) ";
if( $keyword1 ) {
$q .= "\n AND (";
if ($search_limiter=="name") {
$q .= "\n `#__{vm}_product`.`product_name` LIKE '%$keyword1%' ";
$q .= "\n OR (`trad`.`reference_field` = 'product_name' AND `trad`.`value` LIKE '%$keyword1%' )"; // hack yves - aude line
}
elseif ($search_limiter=="cp") {
$q .= "\n `#__{vm}_product`.`product_url` LIKE '%$keyword1%' ";
}
elseif ($search_limiter=="desc") {
$q .= "\n `#__{vm}_product`.`product_s_desc` LIKE '%$keyword1%' OR ";
$q .= "\n `#__{vm}_product`.`product_desc` LIKE '%$keyword1%'";
$q .= "\n OR (`trad`.`reference_field` = 'product_desc' AND `trad`.`value` LIKE '%$keyword1%' )"; // hack yves - aude line
$q .= "\n OR (`trad`.`reference_field` = 'product_s_desc' AND `trad`.`value` LIKE '%$keyword1%' )"; // hack yves - aude line
}
else {
$q .= "\n `#__{vm}_product`.`product_name` LIKE '%$keyword1%' OR ";
$q .= "\n `#__{vm}_product`.`product_url` LIKE '%$keyword1%' OR ";
$q .= "\n `#__{vm}_category`.`category_name` LIKE '%$keyword1%' OR ";
$q .= "\n `#__{vm}_product`.`product_sku` LIKE '%$keyword1%' OR ";
$q .= "\n `#__{vm}_product`.`product_s_desc` LIKE '%$keyword1%' OR ";
$q .= "\n `#__{vm}_product`.`product_desc` LIKE '%$keyword1%'";
$q .= "\n OR `trad`.`value` LIKE '%$keyword1%'"; // hack yves - aude line
}
$q .= "\n ) ";
/*** KEYWORD 2 TO REFINE THE SEARCH ***/
if ( !empty($keyword2) ) {
$q .= "\n $search_op (";
if ($search_limiter=="name") {
$q .= "\n `#__{vm}_product`.product_name LIKE '%$keyword2%' ";
$q .= "\n OR (`trad`.`reference_field` = 'product_name' AND `trad`.`value` LIKE '%$keyword2%' )"; // hack yves - aude line
}
elseif ($search_limiter=="cp") {
$q .= "\n `#__{vm}_product`.product_url LIKE '%$keyword2%' ";
}
elseif ($search_limiter=="desc") {
$q .= "\n `#__{vm}_product`.`product_s_desc` LIKE '%$keyword2%' OR ";
$q .= "\n `#__{vm}_product`.`product_desc` LIKE '%$keyword2%'";
$q .= "\n OR (`trad`.`reference_field` = 'product_desc' AND `trad`.`value` LIKE '%$keyword2%' )"; // hack yves - aude line
$q .= "\n OR (`trad`.`reference_field` = 'product_s_desc' AND `trad`.`value` LIKE '%$keyword2%' )"; // hack yves - aude line
}
else {
$q .= "\n `#__{vm}_product`.`product_name` LIKE '%$keyword2%' OR ";
$q .= "\n `#__{vm}_product`.`product_url` LIKE '%$keyword2%' OR ";
$q .= "\n `#__{vm}_category`.`category_name` LIKE '%$keyword2%' OR ";
$q .= "\n `#__{vm}_product`.`product_sku` LIKE '%$keyword2%' OR ";
$q .= "\n `#__{vm}_product`.product_s_desc` LIKE '%$keyword2%' OR ";
$q .= "\n `#__{vm}_product`.`product_desc` LIKE '%$keyword2%'";
$q .= "\n OR `trad`.`value` LIKE '%$keyword2%'"; // hack yves - aude line
}
$q .= "\n ) ";
}
}
elseif( $keyword ) {
$q .= "\n AND (";
$keywords = explode( " ", $keyword, 10 );
$numKeywords = count( $keywords );
$i = 1;
foreach( $keywords as $searchstring ) {
$searchstring = trim( stripslashes($searchstring) );
if( !empty( $searchstring )) {
if( $searchstring[0] == "\"" || $searchstring[0]=="'" )
$searchstring[0] = " ";
if( $searchstring[strlen($searchstring)-1] == "\"" || $searchstring[strlen($searchstring)-1]=="'" )
$searchstring[strlen($searchstring)-1] = " ";
$searchstring = trim( $searchstring );
$q .= "\n (`#__{vm}_product`.`product_name` LIKE '%$searchstring%' OR ";
$q .= "\n `#__{vm}_product`.`product_sku` LIKE '%$searchstring%' OR ";
$q .= "\n `#__{vm}_product`.`product_s_desc` LIKE '%$searchstring%' OR ";
$q .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%' "; // ) moved 1 line below - hack yves - aude line
$q .= "\n OR `trad`.`value` LIKE '%$searchstring%' ) ";// hack yves - aude line
}
if( $i++ < $numKeywords ) {
$q .= "\n AND ";
}
}
$q .= "\n ) ";
}
$count .= $q;
$q .= "\n GROUP BY `#__{vm}_product`.`product_sku` ";
$q .= "\n ORDER BY $orderbyField $DescOrderBy";
$list .= $q . " LIMIT $limitstart, " . $limit;
}
/*** GET ALL PUBLISHED PRODUCTS FROM THAT MANUFACTURER ***/
elseif (!empty($manufacturer_id)) {
$list = "SELECT DISTINCT *,`#__{vm}_product`.`product_id` FROM (`#__{vm}_product`, `#__{vm}_product_mf_xref`,`#__{vm}_shopper_group` ";
$count = "SELECT $count_name FROM (`#__{vm}_product`, `#__{vm}_product_mf_xref`,`#__{vm}_shopper_group` ";
$q = " manufacturer_id='".$manufacturer_id."' ";
$q .= "\n AND `#__{vm}_product`.`product_id`=`#__{vm}_product_mf_xref`.`product_id` ";
if( $perm->is_registered_customer($my->id) ) {
$list .= ",`#__{vm}_shopper_vendor_xref`) LEFT JOIN `#__{vm}_product_price` ON `#__{vm}_product`.`product_id` = `#__{vm}_product_price`.`product_id` WHERE ";
$count .= ",`#__{vm}_shopper_vendor_xref`) LEFT JOIN `#__{vm}_product_price` ON `#__{vm}_product`.`product_id` = `#__{vm}_product_price`.`product_id` WHERE ";
$q .= "\n AND (`#__{vm}_product`.`product_id`=`#__{vm}_product_price`.`product_id` OR `#__{vm}_product_price`.`product_id` IS NULL) ";
$q .= "\n AND ((`#__{vm}_shopper_vendor_xref`.user_id =".$my->id." ";
$q .= "\n AND `#__{vm}_shopper_vendor_xref`.`shopper_group_id`=`#__{vm}_shopper_group`.`shopper_group_id`) OR `#__{vm}_product_price`.`shopper_group_id` IS NULL) ";
}
else {
$list .= ") LEFT JOIN `#__{vm}_product_price` ON `#__{vm}_product`.`product_id` = `#__{vm}_product_price`.`product_id` WHERE ";
$count .= ") LEFT JOIN `#__{vm}_product_price` ON `#__{vm}_product`.`product_id` = `#__{vm}_product_price`.`product_id` WHERE ";
$q .= "\n AND (`#__{vm}_product`.`product_id`=`#__{vm}_product_price`.`product_id` OR `#__{vm}_product_price`.`product_id` IS NULL) ";
$q .= "\n AND `#__{vm}_shopper_group`.`default` = '1' ";
}
$q .= "\n AND ((`product_parent_id`='0') OR (`product_parent_id`='')) ";
if( !$perm->check("admin,storeadmin") ) {
$q .= "\n AND `product_publish`='Y' ";
if( CHECK_STOCK && PSHOP_SHOW_OUT_OF_STOCK_PRODUCTS != "1") {
$q .= "\n AND product_in_stock > 0 ";
}
}
$count .= $q;
$q .= "\n GROUP BY `#__{vm}_product`.`product_sku` ";
$q .= "\n ORDER BY $orderbyField $DescOrderBy";
$list .= $q . " LIMIT $limitstart, " . $limit;
}
// BACK TO shop.browse.php !
?>
-
Hi,
Unfortunately the hack doesn't work for me. I don't get any search result or filled categories by using the hack. I use:
- Database Version: 5.0.19-standard-log
- PHP Version: 5.1.6
- Joomla 1.0.12 + Virtuemart 1.0.10
Any idea?
Regards,
Raynet
-
Hi to all,
I'm really sorry for those to which this hack is not working, but I would like to join my sincerly thanks to Yves. Writing this hack is a salvation for me and certainly a lot of us.
I would like this hack to be more know and reachable, I had a long time to find it, and it is really indispensable to run a multilangage Joomla and Virtuemart site.
Thanks again :-)
Steve
-
Thank you!
Nice work dude.
-
you are great !!!! everything works fine and nobody else maneged to solve this problem completly besides you!
Thanks thanks thanks!!!
-
Hi, i'm glad i found that thread, i'll try that piece of code first thing in the morning !
I have to admit it's even surprising it's not included in the core code ! :)
-
Hello Guyz!
Its not working with J 1012, VM 1012, JF 1.8. I have MySQL 5.x
Any solutions for the searching?
Thanks!
B.
-
Looks like we're alone... Yves hasn't logged in since september. His patch doesn't work on the new releases, used it for a while!
I'm using Joomla 1.0.15 + Joomfish 1.8 + Virtuemart 1.0.14 now.
If someone knows a patch or solution, don't hesitate, share!
Regards,
saco.
-
its working, but turn off the SEF on the search page! and you have to set your default language with your hands in the file manualy!!
I deleted for myself the categories in the search result, because they are appears only in the default language!
But its working! :)
[attachment cleanup by admin]
-
Hey there!
I meant the Virtuemart search hack made by Yves, not the joomla core search!
-
yes, but this is the working solution...:( I've just found this one...
-
Some body complete this PLS. PLS instruction me to install the search by price, that's good i don't know how to make it work.
Thank u so much. ::)
-
Hello there!
Here is the modified shop_browse_queries.php, based on yves' work. Tested it on VM 1.0.14 and JF 1.8.2.
saco
[attachment cleanup by admin]
-
confirm!
Its hardly working on VM 14 + JF182!
With VM or VM search modules!
Great, thanks a million my hero! :)
-
Its hardly working on VM 14 + JF182!
I'm a little bit confused, is it working or not ?
-
Its working flawlessly! Hardly means at least....in my english... ;D
-
Hi,
I have installed this bot. The results are indeed depending on the language. The only strange thing I can not click on the results. It is just a list, showing productname and catagories. What do I do wrong?
-
I'm back after a long while off Virtuemart development. :-[
Sorry for I have not reply to your posts, but, fortunately, i notice others have updated the hack for new version of VM. :)
I made new hack for multilanguage purpose, maybe some of you will be interested.
(Notification email in multi language)
-
Hello prtouw.
Sorry, but i did not understand you were only looking for "searching module".
The hack modified by Saco is running well.
It only modifies the query. What is display is managed by other programms, so your problem is not here
-
Hi,
I needed this hack to work with latest Joomla(1.5.3),VM(1.1.0) and Joomfish(2.0 Beta) so there was couple of modifications. It was not hard to fix.
- change the first line to:
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
Replace all mosGetParam functions to vmGet.
..and thats it! Works like a charm :)
-
hi! I´m sorry for my english. I need your help with virtuemart.
The shop_search_queries.php file only returns products in multiple languages but i also need categories in multiple language. Can somebody help me please? Virtuemart search only find categories in language by default. I need it with urgency please. I´m using the cahva version.
Thank you so much
-
Could someone (maybe Yves) please advise as to how we can apply this solution to VM1.1.2? Which are the files that need modifying? For example, there is no shop_browse_queries.php file in the new version... :(
Many thanks for any help! :)
-
thank you!!! this is perfect.
-
Hi there,
Based on saco's work, here is the modified shop_browse_queries.php tested on VM 1.1.13 and JF 2.0.2
Enjoy!
Regards,
Loic
[attachment cleanup by admin]
-
Thanks so much... I will try it!
Cheers,
B.
-
Hello,
Has anyone got a similar solution when using vmxsearch.plugin.php?
It seems to me the solution posted in this thread is related to VM own search facility, when using Joomla's core search facilities (mod_search + com_search + search plug-ins), shop_browse_queries.php is not used but vmxsearch.plugin.php.
How can I make sure the db query in that file gets handled by JF?
Thank you in advance.
-
Hello,
The modified shop_browse_queries.php by loic worked for me, just when I was about to give up ...
Joomla version 1.5.10
Virtuemart 1.1.3
Joom!Fish Version V2.0.3
Thank you to everyone who made it possible :-)
-
Hello,
I use Joomla version 1.15.9
Virtuemart 1.1.3
Joomfish 2.03
I have follow all instructions but I till have the same problem, I have the headline of the results (as he find search results) but I have a blank page under. So I can't see any results from the search. Is someone have an idea ?
Thank for all suggest !
-
like Knud lazuri, I have:
Joomla version 1.5.10
Virtuemart 1.1.3
Joom!Fish Version V2.0.3
I use English language as primary, Portuguese, Spanish and German
O used shop_browse_queries.php by loic and the search is working now for all languages but i have this error in the search result:
Notice: Undefined variable: jf in C:\Program Files\EasyPHP 3.0\www\juvenalcork\administrator\components\com_virtuemart\html\shop_browse_queries.php on line 47
Any help?
Thanks!
-
I think your shop_browse_queries.php is not configured for local. WHat have you in line 47 ?
-
problem fix
thanks any way
-
Have same problem, could you tell me what you did to fix it?
-
So, i would
like to ask another question. Can I resell any national domain
like .az, .ru, .uz, .eu? for example i have got book.ru domain and wanna sell that. what is the juridiction procedure ?Is there any law regulating that?
Thanks beforehand...
Eyvaz Alishov
-
Works perfect, thank you.
Also the virtuemart product scroller shows products in the correc languages.
-
Thank you!!!! Fixed my issue as well.
-
Thank you!
-
I am running a vm website with joomla 1.5.14 + vm1.1.3 + joomfish 2.03
I applied this product search hack in order to search vm product in all language.
what I did is add the following coding in shop_browse_queries.php file
// hack joomfish
$jf .= "LEFT JOIN ( SELECT `reference_field` , `reference_id` , `value` FROM `#__jf_content`";
$jf .= " WHERE `reference_table` = 'vm_product' AND `published` = 1 " ;
$t = array();
if (!empty($keyword)) $t[] = " `value` LIKE '%$keyword%'";
if (!empty($keyword1)) $t[] = " `value` LIKE '%$keyword1%'";
if (!empty($keyword2)) $t[] = " `value` LIKE '%$keyword2%'";
if (count($t)) $jf .= " AND ( " . implode(" OR ", $t) . " ) ";
$jf .= ") AS trad ON `#__{vm}_product`.`product_id` = `trad`.`reference_id`";
$join_array[] = $jf;
// end hack
after a few days, My website was shutdown by hosting company because of the slow mysql query and high CPU usage. This happen after the hack was applied.
The related sql statement is as follow
# Query_time: 15 Lock_time: 0 Rows_sent: 412 Rows_examined: 1576917
SELECT DISTINCT `product_name`,`products_per_row`,`category_browsepage`,`category_flypage`,`jos_vm_category`.`category_id`,
`jos_vm_product`.`product_id`,`product_full_image`,`product_thumb_image`,`product_s_desc`,`product_parent_id`,`product_publish`,`product_in_stock`,`product_sku`, `product_url`,
`product_weight`,`product_weight_uom`,`product_length`,`product_width`,`product_height`,`product_lwh_uom`,`product_in_stock`,`product_available_date`,`product_availability`,`jos_vm_product`.`mdate`, `jos_vm_product`.`cdate` FROM (`jos_vm_product`, `jos_vm_category`, `jos_vm_product_category_xref`,`jos_vm_shopper_group`) LEFT JOIN `jos_vm_product_price` ON `jos_vm_product`.`product_id` = `jos_vm_product_price`.`product_id`
LEFT JOIN ( SELECT `reference_field` , `reference_id` , `value` FROM `jos_jf_content` WHERE `reference_table` = 'vm_product' AND `published` = 1 ) AS trad ON `jos_vm_product`.`product_id` = `trad`.`reference_id` WHERE `jos_vm_product_category_xref`.`product_id`=`jos_vm_product`.`product_id`
AND `jos_vm_product_category_xref`.`category_id`=`jos_vm_category`.`category_id`
AND ((`jos_vm_product`.`product_id`=`jos_vm_product_price`.`product_id` AND `jos_vm_shopper_group`.`shopper_group_id`=`jos_vm_product_price`.`shopper_group_id`) OR `jos_vm_product_price`.`product_id` IS NULL)
AND `jos_vm_shopper_group`.`default` = 1
AND `product_parent_id`=0
AND `product_publish`='Y'
AND `category_publish`='Y'
GROUP BY `jos_vm_product`.`product_sku`
ORDER BY `jos_vm_product`.`cdate` DESC LIMIT 0, 2000;
I guess it is because the sql statement is too long and the result row is too much (Rows_examined: 1576917).
there are only about 400 products in my vm shop.
Does anyone know what the problem is??? is there any fix??
Thanks
-
I've been using the modified file from Yves on the first page or second i don't remember now, and after a few my Dedicated server was getting really really slow, to don't talk about the website.
The mysql server was loaded severely, using in most cases 100% of both cpu installed on the server, so I had to come back to the original file.
Has anyone a solution for this, or an alternative to can search in all joomfish languages?
-
Seems to be no solution to this problem ! :(
-
HI modified with a friend's help the file I downloaded from you on this post.
We've added the variable `reference_field` = 'product_name'" ;
in this way you make search only into the products fieldm, and not into the short description, and description fields.
This load less then the one hacked from Yves the mysql server.
I'm using it from 4 days with Joomla 1.5.15 +JOomfish 2.04 and virtuemart 1.1.4
I'm having an huge traffic on the site in these days ad everything is working fine.
Let's try it and let me know http://www.fesal.info/multilanguage_search.zip (http://www.fesal.info/multilanguage_search.zip)
-
would you guys be able to add to this hack somethings that tells to search only through product name field and only into the session language?
// hack joomfish
$jf .= "LEFT JOIN ( SELECT `reference_field` , `reference_id` , `value` FROM `#__jf_content`";
$jf .= " WHERE `reference_table` = 'vm_product' AND `published` = 1 " ;
$t = array();
if (!empty($keyword)) $t[] = " `value` LIKE '%$keyword%'";
if (!empty($keyword1)) $t[] = " `value` LIKE '%$keyword1%'";
if (!empty($keyword2)) $t[] = " `value` LIKE '%$keyword2%'";
if (count($t)) $jf .= " AND ( " . implode(" OR ", $t) . " ) ";
$jf .= ") AS trad ON `#__{vm}_product`.`product_id` = `trad`.`reference_id`";
$join_array[] = $jf;
// end hack
-
Hello everyone,
I have implemented this piece of code, as you were so kind to provide, into shop_browse_queries.php
// hack joomfish
$jf .= "LEFT JOIN ( SELECT `reference_field` , `reference_id` , `value` FROM `#__jf_content`";
$jf .= " WHERE `reference_table` = 'vm_product' AND `published` = 1 " ;
$t = array();
if (!empty($keyword)) $t[] = " `value` LIKE '%$keyword%'";
if (!empty($keyword1)) $t[] = " `value` LIKE '%$keyword1%'";
if (!empty($keyword2)) $t[] = " `value` LIKE '%$keyword2%'";
if (count($t)) $jf .= " AND ( " . implode(" OR ", $t) . " ) ";
$jf .= ") AS trad ON `#__{vm}_product`.`product_id` = `trad`.`reference_id`";
$join_array[] = $jf;
// end hack
and the virtuemart search is much faster now. I have two languages on my site and can search in both of them. (I cannot switch between languages within the search however. When I try that, the search results are gone and it takes a long time to come up with all of the products: about 14.000. But then, who would want to switch languages once shopping?)
What I would really like, up to the point of really need, is the search for product_type_values to be multilinguistic (or is it multilingual?) Anyway, that one can filter product_type_values in several languages. E.g. product_type 'Television'; values: EN: 'New','Secondhand', NL: 'Nieuw', 'Tweedehands'. I have succeeded using Joomfish to translate the search values already, but the search is restricted to vm_product_type_# (I guess from looking at shop_browse_queries) and in that table are no translations.
Does anyone know a solution or has experience with this? Any help would be greatly appreciated.
Thanks very much and greetings from the Netherlands.
-
Hi all,
this can't be faster since you will also need the reference id in the MySQL WHERE clause as it is part of the jos_jf_content table's combo index (I am talking about this line: $jf .= " WHERE `reference_table` = 'vm_product' AND `published` = 1 AND `reference_field` = 'product_name'" ;).
To make your search faster and also be able to search in joomfish translated products you can replace the above part:
// hack joomfish
$jf .= "LEFT JOIN ( SELECT `reference_field` , `reference_id` , `value` FROM `#__jf_content`";
$jf .= " WHERE `reference_table` = 'vm_product' AND `published` = 1 AND `reference_field` = 'product_name'" ;
$t = array();
if (!empty($keyword)) $t[] = " `value` LIKE '%$keyword%'";
if (!empty($keyword1)) $t[] = " `value` LIKE '%$keyword1%'";
if (!empty($keyword2)) $t[] = " `value` LIKE '%$keyword2%'";
if (count($t)) $jf .= " AND ( " . implode(" OR ", $t) . " ) ";
$jf .= ") AS trad ON `#__{vm}_product`.`product_id` = `trad`.`reference_id`";
$join_array[] = $jf;
// end hack
with this one:
// hack joomfish
$jf .= "LEFT JOIN `#__jf_content` AS trad ON `#__{vm}_product`.`product_id` = `trad`.`reference_id`";
$join_array[] = $jf;
// end hack
Don't forget that there are some other places as well in shop_browse_queries.php where you will have to make some additions/modifications.
For those interested I am attaching my version of shop_browse_queries.php.
Hope this helps!
Take care,
Yiannis
[attachment cleanup by admin]
-
I am using Joomla 1.5.15, Joom!Fish Version V2.1.5 and VirtueMart 1.1.6 .
The hack
// hack joomfish
$jf .= "LEFT JOIN `#__jf_content` AS trad ON `#__{vm}_product`.`product_id` = `trad`.`reference_id`";
$join_array[] = $jf;
// end hack
is not working for me.
I made the my file according tsili's file.
-
Hi dianbg,
Did you apply all the changes marked with 'hack' in shop_browse_queries.php?
Apart from the code you are attaching you will have to modify other lines as well. Please search the file I am attaching for the word 'hack' and apply accordingly.
Thanx!
-
Hi all,
I really confused what I have to do could you please tell me what I have to do now and where should I start?
my Joomla is 1.5.22
my Joomfish is 2.1.5
and also my vM is 1.1.7
Pleasssssss help me !!:D
Regards,
-
Hi 8tarkhan,
Just follow my post above (the one I am attaching the file). If you have problems let me know.
Cheers!
-
Hi,
First of all thank you for your fast replay, secondly could you please tell me to which folder should I upload this file?
Thank you again,
-
Hi 8tarkhan,
You will find the file in: administrator\components\com_virtuemart\html
Cheers
-
Hi I get "error 500" could you please tell me what i have to do?
I have done whatever you said and I think I did correctly but still I can not fix this problem.
-
No search in second language in VM 1.1.7 ::)
Thanks
-
Sorry I'm a newbie - which languages pack I can use for 1.1.7. to change from english to german? or do I have to install an other version first and then make an update?
-
doesn't work not 1st, not 2nd hack :-\
joomla 1.5.23
vm 1.1.9
jf 2.0.4
-
Great hack! Works wonders! Should be as standard..
Joomla 1.5.26
Virtuemart 1.1.8
Joom!Fish Version V2.2.3
Hi all,
this can't be faster since you will also need the reference id in the MySQL WHERE clause as it is part of the jos_jf_content table's combo index (I am talking about this line: $jf .= " WHERE `reference_table` = 'vm_product' AND `published` = 1 AND `reference_field` = 'product_name'" ;).
To make your search faster and also be able to search in joomfish translated products you can replace the above part:
// hack joomfish
$jf .= "LEFT JOIN ( SELECT `reference_field` , `reference_id` , `value` FROM `#__jf_content`";
$jf .= " WHERE `reference_table` = 'vm_product' AND `published` = 1 AND `reference_field` = 'product_name'" ;
$t = array();
if (!empty($keyword)) $t[] = " `value` LIKE '%$keyword%'";
if (!empty($keyword1)) $t[] = " `value` LIKE '%$keyword1%'";
if (!empty($keyword2)) $t[] = " `value` LIKE '%$keyword2%'";
if (count($t)) $jf .= " AND ( " . implode(" OR ", $t) . " ) ";
$jf .= ") AS trad ON `#__{vm}_product`.`product_id` = `trad`.`reference_id`";
$join_array[] = $jf;
// end hack
with this one:
// hack joomfish
$jf .= "LEFT JOIN `#__jf_content` AS trad ON `#__{vm}_product`.`product_id` = `trad`.`reference_id`";
$join_array[] = $jf;
// end hack
Don't forget that there are some other places as well in shop_browse_queries.php where you will have to make some additions/modifications.
For those interested I am attaching my version of shop_browse_queries.php.
Hope this helps!
Take care,
Yiannis
-
;)