]> _ Git - pmi.git/commitdiff
wip #3010 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 6 Sep 2019 13:32:47 +0000 (15:32 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 6 Sep 2019 13:32:47 +0000 (15:32 +0200)
app/Models/Product.php

index 995ad63a94670ba8befd1c353b53618dcb5f90e0..729f937ae378ee410db1fda291747535667e0dc2 100644 (file)
@@ -419,9 +419,12 @@ class Product extends CubistMagicPageModel
             if ($data->type == 'list') {
                 $options = [];
                 $values = [];
+
                 foreach ($products as $product) {
+
                     $v = $product->get($spec_name);
-                    if (!$v) {
+                    $allv[$product->id] = $v;
+                    if (null === $v) {
                         $v = '-';
                     }
                     if (!isset($values[$v])) {
@@ -435,7 +438,11 @@ class Product extends CubistMagicPageModel
                             $matching[] = $product->id;
                         }
                     }
+
                 }
+
+
+
                 foreach ($data->options as $index => $option) {
                     if (is_scalar($option)) {
                         $o = $option;
@@ -467,7 +474,7 @@ class Product extends CubistMagicPageModel
                 foreach ($products as $product) {
                     $v = $product->get($spec_name);
 
-                    if(null===$v){
+                    if (null === $v) {
                         $matching[] = $product->id;
                         continue;
                     }
@@ -480,7 +487,7 @@ class Product extends CubistMagicPageModel
                             $min = min($v['first'], $v['second']);
                             $max = max($v['first'], $v['second']);
 
-                            if (null===$v || ($min <= $filter_value[1] && $max >= $filter_value[0])) {
+                            if (null === $v || ($min <= $filter_value[1] && $max >= $filter_value[0])) {
                                 $matching[] = $product->id;
                             }
                         }
@@ -488,7 +495,7 @@ class Product extends CubistMagicPageModel
                         $f['min'] = min($f['min'], $v);
                         $f['max'] = min($f['max'], $v);
                         if (null !== $filter_value) {
-                            if (null===$v || ($v >= $filter_value[0] && $v <= $filter_value[0])) {
+                            if (null === $v || ($v >= $filter_value[0] && $v <= $filter_value[0])) {
                                 $matching[] = $product->id;
                             }
                         }