VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: fabioweb on October 01, 2016, 12:35:10 PM

Title: More categories in a single page
Post by: fabioweb on October 01, 2016, 12:35:10 PM
Hello guys,
In virtuemart demo frontend i can see these two categories:

http://demo.virtuemart.net/wear/lady
http://demo.virtuemart.net/wear/mister

My question is: How can we merge "Lady" product and "Mister" product in order to get on the same page Wear:

Mister
____________________

T-Shirt classic blue - Dress Shirt with tie - Zipper pullover

Lady
___________________

Skirt "Knock-Rock" - T-Shirt classic blue - etc...

Thank you!







Title: Re: More categories in a single page
Post by: GJC Web Design on October 01, 2016, 12:47:50 PM
http://demo.virtuemart.net/wear

and enable as-> http://forum.virtuemart.net/index.php?topic=121017
Title: Re: More categories in a single page
Post by: fabioweb on October 01, 2016, 23:18:28 PM
So i have to replace the original code with this? Where?



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.') ';
}



Thank you
Title: Re: More categories in a single page
Post by: GJC Web Design on October 02, 2016, 11:24:55 AM
the code is already there!

administrator\components\com_virtuemart\models\product.php  -> set to false to enable the 2nd condition
Title: Re: More categories in a single page
Post by: fabioweb on October 02, 2016, 16:54:13 PM
Ok thank you!
here i'm rendering all "Camere" subcategories: http://seratadigala.tioitalia.it/it/camere

Is it possible to display also title category?
"Camere Standard" and 4 products
<br/>
"Camere Junior" and 1 product

regards!