Dear VM pros!
I have i.e. following category hierarchie:
- Cat1
- - Cat1_1
- - - Cat1_1_1
- Cat2
...
On the browsepage I need to display all products not only i.e. of Cat1, but also of Cat1_1 and Cat1_1_1.
Do you have any idea how to achieve that?
Thank you very much in advance for your help!
Best regards,
Gerald
Hello all!
One month ago I posted about listing products in subcategories.
Does anyone have any idea how to solve that issue?
Best regards
Gerald
*push* ;)
Develop a plugin?
You did not get a response because the question is vague.
QuoteI have i.e. following category hierarchie:
- Cat1
- - Cat1_1
- - - Cat1_1_1
- Cat2
...
On the browsepage I need to display all products not only i.e. of Cat1, but also of Cat1_1 and Cat1_1_1.
In which browse page? When do you want to get products from these?
He wants to display products of child categories in parent category. This can be done with core hack. I'm sure a solution (for VM2) was posted on this forum at some point.
Another option is to assign products to parent categories. This plugin can do it automatically https://extensions.joomla.org/extension/auto-parent-categories-for-virtuemart-joomla-3-x.
Check that
https://extensions.joomla.org/extension/auto-parent-categories-for-virtuemart
It may help
there is also a switch in the products model for this ...
see around line 367
if ($virtuemart_category_id > 0) {
$joinCategory = TRUE;
if(true){
$where[] = ' `pc`.`virtuemart_category_id` = ' . $virtuemart_category_id;
} else {
/*GJC add subcat products*/
$catmodel = VmModel::getModel ('category');
$childcats = $catmodel->getChildCategoryList(1, $virtuemart_category_id,null, null, true);
$cats = $virtuemart_category_id;
foreach($childcats as $childcat){
$cats .= ','.$childcat->virtuemart_category_id;
}
$joinCategory = TRUE;
$where[] = ' `pc`.`virtuemart_category_id` IN ('.$cats.') ';
}