Generic_Child_Variant Bug: Parent-Product appears multiple times in dropdown

Started by doell-computer, April 21, 2012, 16:56:09 PM

Previous topic - Next topic

doell-computer

2.0.6
If the parent-product is assigned to more then one category it appears multiple times in dropdown-list.

[attachment cleanup by admin]

mark R

Seek and ye shall find.........
4 VM sites and counting

doell-computer

I hope this bug will be fixed soon. I tried to fix it, didn't get it to work  :-[
I would pay for it!

Wird das gefixt? Kann doch nicht so ein riesiges Problem sein. Leider reichen meine php-Kenntnisse dafür nicht aus.
Würds auch bezahlen.

teobgeno

At administrator/components/com_virtuemart/models/product.php -> function getUncategorizedChildren($selected)

The query on this function return multiple virtuemart_product_id in case this virtuemart_product_id belongs to more than 1 category

Line 1549 - 1553

if($app->isSite()){
$q .= ' AND p.`published`="1"';
}

$q .= ' ORDER BY ordering DESC';


By adding a group by on this the issue seems to be solved .So modify it as below


if($app->isSite()){
$q .= ' AND p.`published`="1"';
}

$q .= ' GROUP BY `virtuemart_product_id`';
        $q .= ' ORDER BY ordering DESC';


Beware that GROUP BY is before ORDER BY . Do not change position or else it will throw a  mysql error. I hope this will solve this problem .Because i have not completely tested it i would like if anyone use this modification to reply if everything is ok after this change.
Quote
I would pay for it!
No need to pay  ;)



teobgeno

nice to hear that your problem solved but please make some tests and reply if everything is ok.

doell-computer