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

Falang and VirtueMart conflict?

Started by nicolechen, February 11, 2012, 13:11:23 PM

Previous topic - Next topic

Studio 42

Hi sbou,
YOu are in the Virtuemart forum and not falang then plz do not compare without any reason.
- First if you want to compare remember i give you some feedback from your developement(in joomla.fr).
- Second We don't provide support to falang or joomfish because the systême is slowing down websites but our system include FREE in virtuemart do not slow down your web site and are native in virtuemart core.
Some joomla guy are interested by the use of the virtuemart way to do. Why not simply use this patern to provide a real fast solution ?
I want only see your system on a E-Shop with 100000 products in 5 langs.
I have tested joomfish(same patern as your fork) in some site with very bad result. Sorry it's my opinion and the test we have done give the same feeling.

But if you wan't do it compatible with VM2 i don't have objection in all.

If you provide a paid version then please simply give the answer or redirect to your forum/website.
I never said to Joomla user to change CMS, because it's not my role.

Patrick

genetica_multimedia

Also on our sites the category view does't work (with Falang/Joomfish and Virtuemart):

/components/com_virtuemart/views/category/tmpl/default.php

it doesn't read the content of the variable $product, for example: $product->product_name, $product->link, $product->product_s_desc


it works with Virtuemart 2.0.0, JoomFish2.1.7, Joomla 1.5.25
and Virtuemart 2.0.0, Falang 1.1.1, Joomla 2.5.4

but it does't work with the newer versions of Virtuemart, for example, 2.0.2, 2.0.3, 2.0.4. When Joomfish or Falang gets disabled it works.

sbou

Hi,

I found a reason why there are problem between VM and Falang.

When i look in the code of a vm query it's look like :

SELECT SQL_CALC_FOUND_ROWS *
FROM `m62ak_virtuemart_products_en_gb` AS l
JOIN `m62ak_virtuemart_products` AS p USING (`virtuemart_product_id`)
LEFT JOIN `m62ak_virtuemart_product_categories` ON p.`virtuemart_product_id` = `m62ak_virtuemart_product_categories`.`virtuemart_product_id`
LEFT JOIN `m62ak_virtuemart_categories_en_gb` AS c ON c.`virtuemart_category_id` = `m62ak_virtuemart_product_categories`.`virtuemart_category_id`
LEFT JOIN `m62ak_virtuemart_product_shoppergroups` ON p.`virtuemart_product_id` = `m62ak_virtuemart_product_shoppergroups`.`virtuemart_product_id`
LEFT OUTER
JOIN `m62ak_virtuemart_shoppergroups` AS s ON s.`virtuemart_shoppergroup_id` = `m62ak_virtuemart_product_shoppergroups`.`virtuemart_shoppergroup_id`
WHERE (p.`published`="1" AND `m62ak_virtuemart_product_categories`.`virtuemart_category_id` = 1 AND (s.`virtuemart_shoppergroup_id`= "1" OR (s.`virtuemart_shoppergroup_id`) IS NULL))
GROUP BY p.`virtuemart_product_id`
ORDER BY p.virtuemart_product_id ASC


And when you look in the result row , you can see a lot of row null
it's seem that the null row are comming from the join of the  m62ak_virtuemart_shoppergroups 

If you change the first ligne with SELECT l.*,p.*,c.*  they are no more null value


Si I try to change in the /administrator/components/com_virtuemart/helpers/vmtable.php

in the line 379 i change for test :

         $select = ' * FROM `#__virtuemart_products_'.VMLANG.'` as l';
by
         $select = ' l.*,p.*,c.* FROM `#__virtuemart_products_'.VMLANG.'` as l';


All seem to work after that.

It's not the right solution the select must dynamic. But it's probably explain why there are problem between VM and FaLang

When i have the right solution , i will make another post with the right workaround.

Stéphane

genetica_multimedia

Hello, thanks for posting. Which version of Virtuemart do you use? In Virtuemart 2.0.4 i found only these lines in /administrator/components/com_virtuemart/helpers/vmtable.php line 265:


//Version load the tables using JOIN
if($this->_translatable){
$mainTable = $this->_tbl.'_'.VMLANG ;
$select = 'SELECT `'.$mainTable.'`.* ,`'.$this->_tbl.'`.* ';
$from   = ' FROM `'.$mainTable.'` JOIN '.$this->_tbl.' using (`'.$this->_tbl_key.'`)';
} else {
$mainTable = $this->_tbl ;
$select = 'SELECT `'.$mainTable.'`.* ';
$from = ' FROM `'.$mainTable .'` ';
}

if (count($tableJoins)) {
if (!$joinKey) $joinKey = $this->_tbl_key ;
foreach ($tableJoins as $tableId => $table) {
$select .= ',`'.$table.'`.`'.$tableId.'` ';
$from   .= ' LEFT JOIN `'.$table.'` on `'.$table.'`.`'.$joinKey.'`=`'. $mainTable .'`.`'.$joinKey.'`';
}
}

sbou

Hi use the last one 2.0.4

But it's in the producs page
/administrator/components/com_virtuemart/models/product.php


line 378.

Sorry for the mistake

Stéphane

marianaf

Hello,

i had virtuemart working fine and when i installed falang everything was deleted:

vm. 2.0.0

falang free 111 .... >:(

i now have no categories, products or anything!!!!!!!!is there a way to fix it? i already uninstalled te falang component, module and plugin...

thank you

mARIANA

sbou

Actually Falang and virtuemart don't work together.

We speak about this in this thread.

Stéphane

genetica_multimedia

Hello, thanks, your patch works!

I use Falang 1.1.1 and VM 2.0.6 now and changed the line 380 of the file: /administrator/components/com_virtuemart/models/product.php from
$select = ' * FROM `#__virtuemart_products_'.VMLANG.'` as l';
to
$select = ' l.*,p.* FROM `#__virtuemart_products_'.VMLANG.'` as l';

now it works perfectly!


P.S.
i modified your patch-code a little bit (deleted the "c.*") because with the c.* there is an other bug: in the "root-view" where we see all the categories, there get listed also the products. With the c.* these products disappear. Without the c.* the category-view and product-view works.

sbou

Hi,

It's not really a patch because after that you have problem when you want to save product in VM.

I will have a look for a real patch because this select seem to have some problem with falang.

The response send same column name with different value (set or null)

Stéphane

genetica_multimedia

OK.

P.S.
On my site with Joomla 2.5.4, VM 2.0.6 and FaLang 1.1.1 i can create new products, modify and translate them with the modification of the respective codeline in product.php

sbou

Yes ,

You're right with this modification

$select = ' l.*,p.* FROM `#__virtuemart_products_'.VMLANG.'` as l';

all seem to work even if it's not the right solution and only a test solution.

Stéphane

sbou

Hi,

I have a best workaround

In the file /administrator/components/com_virtuemart/models/product.php line 270

if(is_array($virtuemart_shoppergroup_ids)){
foreach ($virtuemart_shoppergroup_ids as $key => $virtuemart_shoppergroup_id){
//$where[] .= '(s.`virtuemart_shoppergroup_id`= "' . (int) $virtuemart_shoppergroup_id . '" OR' . ' (s.`virtuemart_shoppergroup_id`) IS NULL )';
}
//$joinShopper = true;


In this case you don't have to modify the line 379

Stéphane

It's remove the filter by shopper groups

sbou

Hi,

I propose now the right solution:

Line 378 of /administrator/components/com_virtuemart/models/product.php

replace line

if($joinLang){
...
} else {
.....
}


if($joinLang){
            //$select = ' l.*,p.* FROM `#__virtuemart_products_'.VMLANG.'` as l';
            $select = ' p.*,l.*';
            if ($joinCategory) {$select .= ',c.*';}
            if ($joinMf)  {$select .= ',m.*';}
            if ($joinPrice) {$select .= ',pp.*';}
            if ($this->searchcustoms) { $select .= ',pf.*';}
            if (!empty( $PluginJoinTables) ) {$select .= ','.$PluginJoinTables[0].'.*';}
            if ($joinShopper) {$select .= ',s.*';}
$select .= ' FROM `#__virtuemart_products_'.VMLANG.'` as l';
$joinedTables = ' JOIN `#__virtuemart_products` AS p using (`virtuemart_product_id`)';
} else {
            $select = ' p.*';
            if ($joinCategory) {$select .= ',c.*';}
            if ($joinMf)  {$select .= ',m.*';}
            if ($joinPrice) {$select .= ',pp.*';}
            if ($this->searchcustoms) { $select .= ',pf.*';}
            if (!empty( $PluginJoinTables) ) {$select .= ','.$PluginJoinTables[0].'.*';}
            if ($joinShopper) {$select .= ',s.*';}
         $select .= ' FROM `#__virtuemart_products` as p';
$joinedTables = '';
}


Can you mail me directly your feedback about this modification , or post them in the forum.

Stéphane

sander_v_bergen

Hi,

I already have Falang installed on my website. If I install VM2 everything seems fine.
When I try to go to Virtuemart in the component list, it isn't in there. I can go to the virtuemart page by typing the address to the VM backend in the address bar. P
roduct images and descritions are not showing in the frontend.

The fix you provided probably fixes the problem in front end, but is there a way to install VM correctely after installing Falang?

I hope you understand what I mean.

Thanks!

-Sander

sbou

sander_v_bergen : I don't understand what you mean.

VM 2.0 is not in the component list of falang because you need to use the language system integrated in VM. There are an option to have a multilanguage shop.

I think the fix is the best fix and broke nothing.

It's can probably be added in the next release of VM.

Stéphane