From: Vincent Vanwaelscappel Date: Tue, 16 Jul 2019 16:55:08 +0000 (+0200) Subject: wip #2897 @0:15 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=876fc903566047f5ab1f9488abd29cab3c5be4d2;p=pmi.git wip #2897 @0:15 --- diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php index 7837091..9dab2d9 100644 --- a/app/Http/Controllers/ProductController.php +++ b/app/Http/Controllers/ProductController.php @@ -16,10 +16,11 @@ class ProductController extends CubistFrontController $this->_404(); } + $this->data['title'] = $productType->name; $this->data['title'] = $productType->name; $this->data['product_type'] = $productType->getPageData(); $this->data['products'] = []; - $products = Product::where('product_type', $id)->get(); + $products = Product::where('product_type', $id)->where('online', 1)->get(); foreach ($products as $item) { $this->data['products'][$item->id] = $item->getPageData(); } diff --git a/app/Templates/Catalog.php b/app/Templates/Catalog.php index e83d881..767f2ea 100644 --- a/app/Templates/Catalog.php +++ b/app/Templates/Catalog.php @@ -57,6 +57,9 @@ class Catalog extends TemplateAbstract if ($product->product_type != $productType->id) { continue; } + if (!$product->online) { + continue; + } $detail = new Item(); $detail->setTitle($product->name); $detail->setHref($product->slug);