From 3b38fcf40a1d8bf63bac76c313e0c01e8aea0598 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 16 Jul 2019 18:58:10 +0200 Subject: [PATCH] done #2897 @0:05 --- app/Templates/Catalog.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); } } } -- 2.39.5