VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: lgiulio on March 05, 2016, 10:28:43 AM

Title: display products
Post by: lgiulio on March 05, 2016, 10:28:43 AM
Hello,

Joomla 3.4.8
VM 3.0.12


How can I display the products of all subcategories in the main category ?

Thank you

lgiulio

Title: Re: display products
Post by: GJC Web Design on March 05, 2016, 11:34:02 AM
administrator\components\com_virtuemart\models\product.php ~ line 332

enable the deeper query

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.') ';
}
Title: Re: display products
Post by: lgiulio on March 05, 2016, 16:33:36 PM
Thank you.

I can not understand where to change .
Can you help me?


lgiulio
Title: Re: display products
Post by: GJC Web Design on March 05, 2016, 19:36:02 PM
try changing

if(true){

to
if(false){
Title: Re: display products
Post by: heslikk on May 29, 2017, 10:39:23 AM
works, but does not work filter by manufacturer