VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: Tchiorny on June 14, 2012, 18:12:39 PM

Title: generic child variants
Post by: Tchiorny on June 14, 2012, 18:12:39 PM
Hello,

I have products available in different packagings (50 seeds, 100 seeds,...). As I understand, this is a situation where using child products is appropriate. So I've set the smallest package as the parent product and the bigger packages as child products. A parent product may belong to multiple categories (e.g., product "Danvers carrot, 30 seeds" belongs to four categories : "Vegetables", "Roots", "Apiacea" and "Carrots"). Categories are not set for a child product (e.g., "Danvers carrot, 60 seeds"), so it's hidden when browsing categories, but it will still show up if searched by name, what is fine. Thanks to the "generic child variants" custom field, currently shown packaging is preselected in the drop down menu which allows to eventually select another packaging. But the problem is that the parent product appears as many times in the list as to how many categories it belongs to (e.g., the "Danvers carrot, 30 seeds" appears four times in the list while "Danvers carrot, 60 seeds" appears only once). If I set only one category for the the parent product, then it's listed only once, as should be. So it seems that 0 or 1 category is OK, but more categories gives duplicates in the list. Maybe due to a faulty loop in the code ?

My environment : VirtueMart 2.0.6, Joomla 2.5.4 and PHP 5.3.10, all on remote server.
Title: Re: generic child variants
Post by: Milbo on June 14, 2012, 22:03:53 PM
Interesting

there is a group by missing.
Quote from: Tchiorny on June 14, 2012, 18:12:39 PM
the problem is that the parent product appears as many times in the list

Which list? Please give a link
Title: Re: generic child variants
Post by: Tchiorny on June 14, 2012, 23:04:50 PM
Hi Milbo,

I meant the list of child products displayed in the drop down menu, like in this example (http://www.dujardinaubalcon.be/notre-boutique-en-ligne/legumes/tomate-yellow-pear-shaped-50-graines-detail.html) where the parent product appears four times as it belongs to four categories.