From: Vincent Vanwaelscappel Date: Tue, 16 Jul 2019 16:58:10 +0000 (+0200) Subject: done #2897 @0:05 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=3b38fcf40a1d8bf63bac76c313e0c01e8aea0598;p=pmi.git done #2897 @0:05 --- diff --git a/app/Templates/Catalog.php b/app/Templates/Catalog.php index 767f2ea..bfe4776 100644 --- a/app/Templates/Catalog.php +++ b/app/Templates/Catalog.php @@ -51,8 +51,8 @@ class Catalog extends TemplateAbstract $category->setHref($productType->slug); $category->setId('product_type_' . $productType->id); $category->setController(['controller' => 'ProductController', 'action' => 'productList', 'params' => ['id' => $productType->id]]); - $item->addChild($category); + $count = 0; foreach ($products as $product) { if ($product->product_type != $productType->id) { continue; @@ -66,6 +66,11 @@ class Catalog extends TemplateAbstract $detail->setId('product/' . $product->id); $detail->setController(['controller' => 'ProductController', 'action' => 'productDetails', 'params' => ['id' => $product->id]]); $category->addChild($detail); + $count++; + } + + if ($count) { + $item->addChild($category); } } }