Completed
Push — master ( e7c2e1...989877 )
by Alexey
05:39
created
system/modules/Ecommerce/appControllers/content/Cart/orderDetail.php 2 patches
Indentation   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@  discard block
 block discarded – undo
8 8
         </tr>
9 9
       </thead>
10 10
       <?php
11
-      $orderDeatilCols = [
12
-          'id' => '№ Заказа',
13
-          'complete_data' => 'Дата заказа'
14
-      ];
15
-      ?>
11
+        $orderDeatilCols = [
12
+            'id' => '№ Заказа',
13
+            'complete_data' => 'Дата заказа'
14
+        ];
15
+        ?>
16 16
       <tbody>
17 17
         <tr>
18 18
           <td class="text-left" style="width: 50%;">              
@@ -65,91 +65,91 @@  discard block
 block discarded – undo
65 65
         </thead>
66 66
         <tbody>
67 67
           <?php
68
-          $sums = [];
69
-          foreach ($cart->cartItems as $cartItem) {
70
-              $item = $cartItem->item;
71
-              $itemName = $item->name();
72
-              if (!isset($sums[$cartItem->price->currency_id])) {
73
-                  $sums[$cartItem->price->currency_id] = $cartItem->price->price;
74
-              } else {
75
-                  $sums[$cartItem->price->currency_id] += $cartItem->price->price;
76
-              }
77
-              ?>
68
+            $sums = [];
69
+            foreach ($cart->cartItems as $cartItem) {
70
+                $item = $cartItem->item;
71
+                $itemName = $item->name();
72
+                if (!isset($sums[$cartItem->price->currency_id])) {
73
+                    $sums[$cartItem->price->currency_id] = $cartItem->price->price;
74
+                } else {
75
+                    $sums[$cartItem->price->currency_id] += $cartItem->price->price;
76
+                }
77
+                ?>
78 78
               <tr>
79 79
                 <td class="text-left"><?= $itemName; ?></td>
80 80
                 <td class="text-right"><?= $cartItem->count; ?></td>
81 81
                 <td class="text-right"><?= $cartItem->price->price; ?> 
82 82
                   <?php
83
-                  if (App::$cur->money) {
84
-                      $currency = Money\Currency::get($cartItem->price->currency_id);
85
-                      if ($currency) {
86
-                          echo $currency->acronym();
87
-                      } else {
88
-                          echo 'руб.';
89
-                      }
90
-                  } else {
91
-                      echo 'руб.';
92
-                  }
93
-                  ?></td>
83
+                    if (App::$cur->money) {
84
+                        $currency = Money\Currency::get($cartItem->price->currency_id);
85
+                        if ($currency) {
86
+                            echo $currency->acronym();
87
+                        } else {
88
+                            echo 'руб.';
89
+                        }
90
+                    } else {
91
+                        echo 'руб.';
92
+                    }
93
+                    ?></td>
94 94
                 <td class="text-right"><?= ($cartItem->price->price * $cartItem->count); ?>
95 95
                   <?php
96
-                  if (App::$cur->money) {
97
-                      $currency = Money\Currency::get($cartItem->price->currency_id);
98
-                      if ($currency) {
99
-                          echo $currency->acronym();
100
-                      } else {
101
-                          echo 'руб.';
102
-                      }
103
-                  } else {
104
-                      echo 'руб.';
105
-                  }
106
-                  ?></td>
96
+                    if (App::$cur->money) {
97
+                        $currency = Money\Currency::get($cartItem->price->currency_id);
98
+                        if ($currency) {
99
+                            echo $currency->acronym();
100
+                        } else {
101
+                            echo 'руб.';
102
+                        }
103
+                    } else {
104
+                        echo 'руб.';
105
+                    }
106
+                    ?></td>
107 107
                 <td class="text-right" style="white-space: nowrap;">
108 108
                   <a onclick = 'inji.Ecommerce.Cart.addItem(<?= $item->getPrice()->id; ?>, 1);
109 109
                           return false;' data-original-title="Добавить в корзину" href="#" data-toggle="tooltip" title="" class="btn btn-primary"><i class="glyphicon glyphicon-shopping-cart"></i></a>
110 110
               </tr>
111 111
               <?php
112
-          }
113
-          ?>
112
+            }
113
+            ?>
114 114
         </tbody>
115 115
         <tfoot>
116 116
           <tr>
117 117
             <td colspan="2"></td>
118 118
             <td class="text-right"><b>Сумма</b></td>
119 119
             <td class="text-right"><?php
120
-              foreach ($sums as $currency_id => $sum) {
121
-                  if (!$sum) {
122
-                      continue;
123
-                  }
124
-                  echo number_format($sum, 2, '.', ' ');
125
-                  if (App::$cur->money) {
126
-                      $currency = Money\Currency::get($currency_id);
127
-                      if ($currency) {
128
-                          echo '&nbsp;' . $currency->acronym();
129
-                      } else {
130
-                          echo '&nbsp;руб.';
131
-                      }
132
-                  } else {
133
-                      echo '&nbsp;руб.';
134
-                  }
135
-                  echo '<br />';
136
-              }
137
-              ?></td>
120
+                foreach ($sums as $currency_id => $sum) {
121
+                    if (!$sum) {
122
+                        continue;
123
+                    }
124
+                    echo number_format($sum, 2, '.', ' ');
125
+                    if (App::$cur->money) {
126
+                        $currency = Money\Currency::get($currency_id);
127
+                        if ($currency) {
128
+                            echo '&nbsp;' . $currency->acronym();
129
+                        } else {
130
+                            echo '&nbsp;руб.';
131
+                        }
132
+                    } else {
133
+                        echo '&nbsp;руб.';
134
+                    }
135
+                    echo '<br />';
136
+                }
137
+                ?></td>
138 138
             <td></td>
139 139
           </tr>
140 140
           <?php
141
-          $deliveryCurrency = $cart->delivery ? $cart->delivery->currency_id : 0;
142
-          $deliveryPrice = $cart->delivery->price;
143
-          if (!isset($sums[$deliveryCurrency])) {
144
-              $sums[$deliveryCurrency] = $deliveryPrice;
145
-          } else {
146
-              $sums[$deliveryCurrency] += $deliveryPrice;
147
-          }
148
-          $delCurrency = false;
149
-          if (App::$cur->money) {
150
-              $delCurrency = Money\Currency::get($deliveryPrice);
151
-          }
152
-          ?>
141
+            $deliveryCurrency = $cart->delivery ? $cart->delivery->currency_id : 0;
142
+            $deliveryPrice = $cart->delivery->price;
143
+            if (!isset($sums[$deliveryCurrency])) {
144
+                $sums[$deliveryCurrency] = $deliveryPrice;
145
+            } else {
146
+                $sums[$deliveryCurrency] += $deliveryPrice;
147
+            }
148
+            $delCurrency = false;
149
+            if (App::$cur->money) {
150
+                $delCurrency = Money\Currency::get($deliveryPrice);
151
+            }
152
+            ?>
153 153
           <tr>
154 154
             <td colspan="2"></td>
155 155
             <td class="text-right"><b><?= $cart->delivery ? $cart->delivery->name : 'Доставка'; ?></b></td>
@@ -160,24 +160,24 @@  discard block
 block discarded – undo
160 160
             <td colspan="2"></td>
161 161
             <td class="text-right"><b>Итого</b></td>
162 162
             <td class="text-right"><?php
163
-              foreach ($sums as $currency_id => $sum) {
164
-                  if (!$sum) {
165
-                      continue;
166
-                  }
167
-                  echo number_format($sum, 2, '.', ' ');
168
-                  if (App::$cur->money) {
169
-                      $currency = Money\Currency::get($currency_id);
170
-                      if ($currency) {
171
-                          echo '&nbsp;' . $currency->acronym();
172
-                      } else {
173
-                          echo '&nbsp;руб.';
174
-                      }
175
-                  } else {
176
-                      echo '&nbsp;руб.';
177
-                  }
178
-                  echo '<br />';
179
-              }
180
-              ?></td>
163
+                foreach ($sums as $currency_id => $sum) {
164
+                    if (!$sum) {
165
+                        continue;
166
+                    }
167
+                    echo number_format($sum, 2, '.', ' ');
168
+                    if (App::$cur->money) {
169
+                        $currency = Money\Currency::get($currency_id);
170
+                        if ($currency) {
171
+                            echo '&nbsp;' . $currency->acronym();
172
+                        } else {
173
+                            echo '&nbsp;руб.';
174
+                        }
175
+                    } else {
176
+                        echo '&nbsp;руб.';
177
+                    }
178
+                    echo '<br />';
179
+                }
180
+                ?></td>
181 181
             <td></td>
182 182
           </tr>
183 183
         </tfoot>
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
           <td class="text-left" style="width: 50%;">              
19 19
             <?php
20 20
             foreach ($orderDeatilCols as $col => $label) {
21
-                echo "<b>{$label}</b> " . $cart->$col . "<br>";
21
+                echo "<b>{$label}</b> ".$cart->$col."<br>";
22 22
             }
23 23
             ?>
24 24
           </td>
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             <?php
42 42
             if ($cart->infos) {
43 43
                 foreach ($cart->infos as $info) {
44
-                    echo "<b>{$info->field->name()}</b> " . $info->value . "<br>";
44
+                    echo "<b>{$info->field->name()}</b> ".$info->value."<br>";
45 45
                 }
46 46
             }
47 47
             ?>
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                   if (App::$cur->money) {
126 126
                       $currency = Money\Currency::get($currency_id);
127 127
                       if ($currency) {
128
-                          echo '&nbsp;' . $currency->acronym();
128
+                          echo '&nbsp;'.$currency->acronym();
129 129
                       } else {
130 130
                           echo '&nbsp;руб.';
131 131
                       }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
                   if (App::$cur->money) {
169 169
                       $currency = Money\Currency::get($currency_id);
170 170
                       if ($currency) {
171
-                          echo '&nbsp;' . $currency->acronym();
171
+                          echo '&nbsp;'.$currency->acronym();
172 172
                       } else {
173 173
                           echo '&nbsp;руб.';
174 174
                       }
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
                     case'2':
208 208
                         $price = Ecommerce\Item\Offer\Price::get($status->info);
209 209
                         if ($price) {
210
-                            echo "<a href = '/ecommerce/view/{$item->id}'>" . $price->offer->item->name() . "</a>";
210
+                            echo "<a href = '/ecommerce/view/{$item->id}'>".$price->offer->item->name()."</a>";
211 211
                         } else {
212 212
                             echo 'Товар удален';
213 213
                         }
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
                         $info = explode('|', $status->info);
217 217
                         $price = Ecommerce\Item\Offer\Price::get($info[0]);
218 218
                         if ($price) {
219
-                            echo "<a href = '/ecommerce/view/{$item->id}'>" . $price->offer->item->name() . "</a> " . ($info[1] > 0 ? '+' . $info[1] : $info[1]);
219
+                            echo "<a href = '/ecommerce/view/{$item->id}'>".$price->offer->item->name()."</a> ".($info[1] > 0 ? '+'.$info[1] : $info[1]);
220 220
                         } else {
221 221
                             echo 'Товар удален';
222 222
                         }
Please login to merge, or discard this patch.