Completed
Push — master ( ebb499...f17270 )
by Alexey
03:58
created
system/modules/Ecommerce/objects/OptionsParser.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 
36 36
         //add filter for item type user roles by current user role
37 37
         $selectOptions['where'][] = [
38
-            [Item\Offer\Price\Type::index(), NULL, 'is'],
38
+            [Item\Offer\Price\Type::index(), null, 'is'],
39 39
             [
40 40
                 [Item\Offer\Price\Type::colPrefix() . 'roles', '', '=', 'OR'],
41 41
                 [Item\Offer\Price\Type::colPrefix() . 'roles', '%|' . \Users\User::$cur->role_id . '|%', 'LIKE', 'OR'],
Please login to merge, or discard this patch.
system/modules/Ecommerce/widgets/filters.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <div class="filters">
2 2
     <form>
3 3
       <?php
4
-      $min = App::$cur->ecommerce->getItems(['sort' => ['price' => 'asc'], 'count' => 1, 'key' => false]);
5
-      $max = App::$cur->ecommerce->getItems(['sort' => ['price' => 'desc'], 'count' => 1, 'key' => false]);
6
-      if ($min && $min[0]->getPrice() && $max && $max[0]->getPrice()) {
7
-          ?>
4
+        $min = App::$cur->ecommerce->getItems(['sort' => ['price' => 'asc'], 'count' => 1, 'key' => false]);
5
+        $max = App::$cur->ecommerce->getItems(['sort' => ['price' => 'desc'], 'count' => 1, 'key' => false]);
6
+        if ($min && $min[0]->getPrice() && $max && $max[0]->getPrice()) {
7
+            ?>
8 8
             <label>Фильтр по цене</label>
9 9
             <div class="form-group">      
10 10
                 <div class="row">
@@ -18,24 +18,24 @@  discard block
 block discarded – undo
18 18
             ?>
19 19
             <div class="filter">  
20 20
               <?php
21
-              switch ($option->type) {
22
-                  case 'radio':
21
+                switch ($option->type) {
22
+                    case 'radio':
23 23
                       echo "<label>{$option->name}</label>";
24
-                      foreach ($option->items as $item) {
25
-                          $this->widget('Ui\Form/' . $option->type, [
26
-                              'label' => $item->name,
27
-                              'name' => "filters[options][{$option->id}]",
28
-                              !empty($_GET['filters']['options'][$option->id]) && $_GET['filters']['options'][$option->id] == $item->id ? 'checked' : false,
29
-                              'options' => [
30
-                                  'value' => $item->id,
31
-                              ]
32
-                          ]);
33
-                      }
34
-                      break;
35
-                  case 'select':
24
+                        foreach ($option->items as $item) {
25
+                            $this->widget('Ui\Form/' . $option->type, [
26
+                                'label' => $item->name,
27
+                                'name' => "filters[options][{$option->id}]",
28
+                                !empty($_GET['filters']['options'][$option->id]) && $_GET['filters']['options'][$option->id] == $item->id ? 'checked' : false,
29
+                                'options' => [
30
+                                    'value' => $item->id,
31
+                                ]
32
+                            ]);
33
+                        }
34
+                        break;
35
+                    case 'select':
36 36
                       echo "<label>{$option->name}</label>";
37
-                      foreach ($option->items as $item) {
38
-                          ?>
37
+                        foreach ($option->items as $item) {
38
+                            ?>
39 39
                             <div class="radio">
40 40
                                 <label>
41 41
                                     <input type="checkbox" name = 'filters[options][<?= $option->id; ?>][]' value ="<?= $item->id; ?>" <?= !empty($_GET['filters']['options'][$option->id]) && in_array($item->id, $_GET['filters']['options'][$option->id]) ? 'checked' : ''; ?>>
Please login to merge, or discard this patch.