]> _ Git - pmi.git/commitdiff
fix #3021 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 10 Sep 2019 13:05:58 +0000 (15:05 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 10 Sep 2019 13:05:58 +0000 (15:05 +0200)
app/Models/Product.php

index ebf261daa2f49211be5213c69e4bc655fa04679b..2ff9657fd3744e0d9c45daed1593469deaa17a7c 100644 (file)
@@ -361,13 +361,13 @@ class Product extends CubistMagicPageModel
 
                 foreach ($products as $product) {
                     self::$_cart_data[] = [
-                        'id'        => $product->id,
-                        'name'      => $product->name,
+                        'id' => $product->id,
+                        'name' => $product->name,
                         'reference' => $product->reference,
-                        'category'  => $product->type->name,
-                        'quantity'  => $cart_items[$product->id],
-                        'image'     => $product->image,
-                        'URL'       => $product->url,
+                        'category' => $product->type->name,
+                        'quantity' => $cart_items[$product->id],
+                        'image' => $product->image,
+                        'URL' => $product->url,
                     ];
                 }
             }
@@ -445,7 +445,6 @@ class Product extends CubistMagicPageModel
                 }
 
 
-
                 foreach ($data->options as $index => $option) {
                     if (is_scalar($option)) {
                         $o = $option;
@@ -467,6 +466,7 @@ class Product extends CubistMagicPageModel
                 $f['min'] = INF;
                 $f['max'] = -INF;
                 $f['unit'] = $data->unit;
+                $f['type'] = 'range';
 
                 if ($data->type == 'numeric') {
                     $f['prefix'] = $data['prefix'];
@@ -496,7 +496,7 @@ class Product extends CubistMagicPageModel
                         }
                     } else {
                         $f['min'] = min($f['min'], $v);
-                        $f['max'] = min($f['max'], $v);
+                        $f['max'] = max($f['max'], $v);
                         if (null !== $filter_value) {
                             if (null === $v || ($v >= $filter_value[0] && $v <= $filter_value[0])) {
                                 $matching[] = $product->id;