]> _ Git - pmi.git/commitdiff
wip #2897 @0:15
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Jul 2019 16:55:08 +0000 (18:55 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 16 Jul 2019 16:55:08 +0000 (18:55 +0200)
app/Http/Controllers/ProductController.php
app/Templates/Catalog.php

index 78370918c3ca121e79d8e6bca7994af08c6760fe..9dab2d9339565df05b0d77f170edeadfce1103ba 100644 (file)
@@ -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();
         }
index e83d88148ac0856efb8e05ab4e18c3eb0b743984..767f2ea6078c8e108651166a081ab8a8196b9c45 100644 (file)
@@ -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);