Completed
Push — master ( 308a3c...ebb499 )
by Alexey
08:08
created
system/modules/Ecommerce/models/Cart/Item.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,14 +17,16 @@  discard block
 block discarded – undo
17 17
         if (!$this->id) {
18 18
             $event = new Event(['cart_id' => $this->cart_id, 'user_id' => \Users\User::$cur->id, 'cart_event_type_id' => 1, 'info' => $this->item_offer_price_id]);
19 19
             $event->save();
20
-        } else {
20
+        }
21
+        else {
21 22
             $cur = Item::get($this->id);
22 23
             if ($cur->item_id != $this->item_id) {
23 24
                 $event = new Event(['cart_id' => $this->cart->cart_id, 'user_id' => \Users\User::$cur->id, 'cart_event_type_id' => 2, 'info' => $cur->item_offer_price_id]);
24 25
                 $event->save();
25 26
                 $event = new Event(['cart_id' => $this->cart->cart_id, 'user_id' => \Users\User::$cur->id, 'cart_event_type_id' => 1, 'info' => $this->item_offer_price_id]);
26 27
                 $event->save();
27
-            } else {
28
+            }
29
+            else {
28 30
                 if ($cur->item_offer_price_id != $this->item_offer_price_id) {
29 31
                     $event = new Event(['cart_id' => $this->cart->cart_id, 'user_id' => \Users\User::$cur->id, 'cart_event_type_id' => 3, 'info' => $this->item_offer_price_id]);
30 32
                     $event->save();
@@ -56,14 +58,16 @@  discard block
 block discarded – undo
56 58
             if ($block) {
57 59
                 $block->count = $this->count;
58 60
                 $block->save();
59
-            } else {
61
+            }
62
+            else {
60 63
                 $block = new \Ecommerce\Warehouse\Block();
61 64
                 $block->item_offer_id = $this->price->item_offer_id;
62 65
                 $block->cart_id = $this->cart_id;
63 66
                 $block->count = $this->count;
64 67
                 $block->save();
65 68
             }
66
-        } elseif ($block) {
69
+        }
70
+        elseif ($block) {
67 71
             $block->delete();
68 72
         }
69 73
         $this->cart->checkStage();
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Cart.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -313,7 +313,8 @@  discard block
 block discarded – undo
313 313
             $deliveryPrice = new \Money\Sums([$this->delivery->currency_id => $this->delivery->max_cart_price]);
314 314
             if ($this->delivery->max_cart_price && $sums->greater($deliveryPrice) || $sums->equal($deliveryPrice)) {
315 315
                 $sum->sums = [$this->delivery->currency_id => 0];
316
-            } else if ($this->delivery->prices) {
316
+            }
317
+            else if ($this->delivery->prices) {
317 318
                 foreach ($this->delivery->prices(['order' => ['cart_price', 'asc']]) as $delPrice) {
318 319
                     $deliveryPrice = new \Money\Sums([$delPrice->currency_id => $delPrice->cart_price]);
319 320
                     if ($sums->greater($deliveryPrice) || $sums->equal($deliveryPrice)) {
@@ -323,7 +324,8 @@  discard block
 block discarded – undo
323 324
                 if (!$sum->sums) {
324 325
                     $sum->sums = [$this->delivery->currency_id => $this->delivery->price];
325 326
                 }
326
-            } else {
327
+            }
328
+            else {
327 329
                 $sum->sums = [$this->delivery->currency_id => $this->delivery->price];
328 330
             }
329 331
         }
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Item.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -234,7 +234,8 @@  discard block
 block discarded – undo
234 234
                     if ($option->item_option_searchable && $option->value) {
235 235
                         if ($option->item_option_type != 'select') {
236 236
                             $this->search_index .= $option->value . ' ';
237
-                        } elseif (!empty($option->option->items[$option->value])) {
237
+                        }
238
+                        elseif (!empty($option->option->items[$option->value])) {
238 239
                             $option->option->items[$option->value]->value . ' ';
239 240
                         }
240 241
                     }
@@ -247,7 +248,8 @@  discard block
 block discarded – undo
247 248
                             if ($option->item_offer_option_searchable && $option->value) {
248 249
                                 if ($option->item_offer_option_type != 'select') {
249 250
                                     $this->search_index .= $option->value . ' ';
250
-                                } elseif (!empty($option->option->items[$option->value])) {
251
+                                }
252
+                                elseif (!empty($option->option->items[$option->value])) {
251 253
                                     $option->option->items[$option->value]->value . ' ';
252 254
                                 }
253 255
                             }
@@ -305,7 +307,8 @@  discard block
 block discarded – undo
305 307
         foreach ($offers[0]->prices as $price) {
306 308
             if (!$price->type) {
307 309
                 $curPrice = $price;
308
-            } elseif (
310
+            }
311
+            elseif (
309 312
                     (!$price->type->roles && !$curPrice) ||
310 313
                     ($price->type->roles && !$curPrice && strpos($price->type->roles, "|" . \Users\User::$cur->role_id . "|") !== false)
311 314
             ) {
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Item/Offer/Param.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,8 @@
 block discarded – undo
94 94
     public function value($default = '') {
95 95
         if ($this->option->type != 'select') {
96 96
             return $this->value;
97
-        } elseif ($this->optionItem) {
97
+        }
98
+        elseif ($this->optionItem) {
98 99
             return $this->optionItem->value;
99 100
         }
100 101
         return $default;
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Item/Offer.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,8 @@
 block discarded – undo
89 89
         if ($warehouse) {
90 90
             $warehouse->count +=(float) $count;
91 91
             $warehouse->save();
92
-        } else {
92
+        }
93
+        else {
93 94
             $warehouse = Offer\Warehouse::get([['item_offer_id', $this->id]]);
94 95
             if ($warehouse) {
95 96
                 $warehouse->count +=(float) $count;
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Item/Param.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,8 @@
 block discarded – undo
94 94
     public function value($default = '') {
95 95
         if ($this->option->type != 'select') {
96 96
             return $this->value;
97
-        } elseif ($this->optionItem) {
97
+        }
98
+        elseif ($this->optionItem) {
98 99
             return $this->optionItem->value;
99 100
         }
100 101
         return $default;
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Category.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -132,9 +132,11 @@  discard block
 block discarded – undo
132 132
     public function resolveTemplate() {
133 133
         if ($this->template !== 'inherit') {
134 134
             return $this->template;
135
-        } elseif ($this->template == 'inherit' && $this->category) {
135
+        }
136
+        elseif ($this->template == 'inherit' && $this->category) {
136 137
             return $this->category->resolveTemplate(true);
137
-        } else {
138
+        }
139
+        else {
138 140
             return (!empty(\App::$cur->ecommerce->config['defaultCategoryTemplate']) ? \App::$cur->ecommerce->config['defaultCategoryTemplate'] : 'current');
139 141
         }
140 142
     }
@@ -142,9 +144,11 @@  discard block
 block discarded – undo
142 144
     public function resolveViewer() {
143 145
         if ($this->viewer !== 'inherit') {
144 146
             return $this->viewer;
145
-        } elseif ($this->viewer == 'inherit' && $this->category) {
147
+        }
148
+        elseif ($this->viewer == 'inherit' && $this->category) {
146 149
             return $this->category->resolveViewer(true);
147
-        } else {
150
+        }
151
+        else {
148 152
             return (!empty(\App::$cur->ecommerce->config['defaultCategoryView']) ? \App::$cur->ecommerce->config['defaultCategoryView'] : 'itemList');
149 153
         }
150 154
     }
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/content/Cart/success.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,8 @@
 block discarded – undo
20 20
             <?= $text ?>
21 21
             <p>Спасибо за покупки в нашем интернет-магазине!</p>
22 22
             <?php
23
-        } else {
23
+        }
24
+        else {
24 25
             ?>
25 26
             <h1 class="heading-title">У вас нет недавних заказов</h1>
26 27
             <p>У вас нет недавних заказов</p>
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/content/Cart/orderDetail.php 1 patch
Braces   +24 added lines, -12 removed lines patch added patch discarded remove patch
@@ -71,7 +71,8 @@  discard block
 block discarded – undo
71 71
                       $itemName = $item->name();
72 72
                       if (!isset($sums[$cartItem->price->currency_id])) {
73 73
                           $sums[$cartItem->price->currency_id] = $cartItem->price->price;
74
-                      } else {
74
+                      }
75
+                      else {
75 76
                           $sums[$cartItem->price->currency_id] += $cartItem->price->price;
76 77
                       }
77 78
                       ?>
@@ -84,10 +85,12 @@  discard block
 block discarded – undo
84 85
                                   $currency = Money\Currency::get($cartItem->price->currency_id);
85 86
                                   if ($currency) {
86 87
                                       echo $currency->acronym();
87
-                                  } else {
88
+                                  }
89
+                                  else {
88 90
                                       echo 'руб.';
89 91
                                   }
90
-                              } else {
92
+                              }
93
+                              else {
91 94
                                   echo 'руб.';
92 95
                               }
93 96
                               ?></td>
@@ -97,10 +100,12 @@  discard block
 block discarded – undo
97 100
                                   $currency = Money\Currency::get($cartItem->price->currency_id);
98 101
                                   if ($currency) {
99 102
                                       echo $currency->acronym();
100
-                                  } else {
103
+                                  }
104
+                                  else {
101 105
                                       echo 'руб.';
102 106
                                   }
103
-                              } else {
107
+                              }
108
+                              else {
104 109
                                   echo 'руб.';
105 110
                               }
106 111
                               ?></td>
@@ -126,10 +131,12 @@  discard block
 block discarded – undo
126 131
                                   $currency = Money\Currency::get($currency_id);
127 132
                                   if ($currency) {
128 133
                                       echo '&nbsp;' . $currency->acronym();
129
-                                  } else {
134
+                                  }
135
+                                  else {
130 136
                                       echo '&nbsp;руб.';
131 137
                                   }
132
-                              } else {
138
+                              }
139
+                              else {
133 140
                                   echo '&nbsp;руб.';
134 141
                               }
135 142
                               echo '<br />';
@@ -142,7 +149,8 @@  discard block
 block discarded – undo
142 149
                     $deliveryPrice = $cart->delivery->price;
143 150
                     if (!isset($sums[$deliveryCurrency])) {
144 151
                         $sums[$deliveryCurrency] = $deliveryPrice;
145
-                    } else {
152
+                    }
153
+                    else {
146 154
                         $sums[$deliveryCurrency] += $deliveryPrice;
147 155
                     }
148 156
                     $delCurrency = false;
@@ -169,10 +177,12 @@  discard block
 block discarded – undo
169 177
                                   $currency = Money\Currency::get($currency_id);
170 178
                                   if ($currency) {
171 179
                                       echo '&nbsp;' . $currency->acronym();
172
-                                  } else {
180
+                                  }
181
+                                  else {
173 182
                                       echo '&nbsp;руб.';
174 183
                                   }
175
-                              } else {
184
+                              }
185
+                              else {
176 186
                                   echo '&nbsp;руб.';
177 187
                               }
178 188
                               echo '<br />';
@@ -208,7 +218,8 @@  discard block
 block discarded – undo
208 218
                                     $price = Ecommerce\Item\Offer\Price::get($status->info);
209 219
                                     if ($price) {
210 220
                                         echo "<a href = '/ecommerce/view/{$item->id}'>" . $price->offer->item->name() . "</a>";
211
-                                    } else {
221
+                                    }
222
+                                    else {
212 223
                                         echo 'Товар удален';
213 224
                                     }
214 225
                                     break;
@@ -217,7 +228,8 @@  discard block
 block discarded – undo
217 228
                                     $price = Ecommerce\Item\Offer\Price::get($info[0]);
218 229
                                     if ($price) {
219 230
                                         echo "<a href = '/ecommerce/view/{$item->id}'>" . $price->offer->item->name() . "</a> " . ($info[1] > 0 ? '+' . $info[1] : $info[1]);
220
-                                    } else {
231
+                                    }
232
+                                    else {
221 233
                                         echo 'Товар удален';
222 234
                                     }
223 235
                                     break;
Please login to merge, or discard this patch.