@@ -20,81 +20,81 @@ |
||
20 | 20 | </thead> |
21 | 21 | <tbody> |
22 | 22 | <?php |
23 | - foreach ($carts as $cart) { |
|
24 | - $sums = []; |
|
25 | - foreach ($cart->cartItems as $cartItem) { |
|
26 | - $currency_id = $cartItem->price && $cartItem->price->currency ? $cartItem->price->currency->id : (!empty(\App::$cur->ecommerce->config['defaultCurrency']) ? \App::$cur->ecommerce->config['defaultCurrency'] : 0); |
|
27 | - if (empty($sums[$currency_id])) { |
|
28 | - $sums[$currency_id] = $cartItem->final_price * $cartItem->count; |
|
29 | - } else { |
|
30 | - $sums[$currency_id] += $cartItem->final_price * $cartItem->count; |
|
31 | - } |
|
32 | - } |
|
33 | - if ($cart->delivery && $cart->delivery->price) { |
|
34 | - $currency_id = $cart->delivery->currency_id; |
|
35 | - if (empty($sums[$currency_id])) { |
|
36 | - $sums[$currency_id] = $cart->delivery->price; |
|
37 | - } else { |
|
38 | - $sums[$currency_id] += $cart->delivery->price; |
|
39 | - } |
|
40 | - } |
|
41 | - foreach ($cart->extras as $extra) { |
|
42 | - $currency_id = $extra->currency ? $extra->currency->id : \App::$cur->ecommerce->config['defaultCurrency']; |
|
43 | - if (empty($sums[$currency_id])) { |
|
44 | - $sums[$currency_id] = $extra->price * $extra->count; |
|
45 | - } else { |
|
46 | - $sums[$currency_id] += $extra->price * $extra->count; |
|
47 | - } |
|
48 | - } |
|
49 | - ?> |
|
23 | + foreach ($carts as $cart) { |
|
24 | + $sums = []; |
|
25 | + foreach ($cart->cartItems as $cartItem) { |
|
26 | + $currency_id = $cartItem->price && $cartItem->price->currency ? $cartItem->price->currency->id : (!empty(\App::$cur->ecommerce->config['defaultCurrency']) ? \App::$cur->ecommerce->config['defaultCurrency'] : 0); |
|
27 | + if (empty($sums[$currency_id])) { |
|
28 | + $sums[$currency_id] = $cartItem->final_price * $cartItem->count; |
|
29 | + } else { |
|
30 | + $sums[$currency_id] += $cartItem->final_price * $cartItem->count; |
|
31 | + } |
|
32 | + } |
|
33 | + if ($cart->delivery && $cart->delivery->price) { |
|
34 | + $currency_id = $cart->delivery->currency_id; |
|
35 | + if (empty($sums[$currency_id])) { |
|
36 | + $sums[$currency_id] = $cart->delivery->price; |
|
37 | + } else { |
|
38 | + $sums[$currency_id] += $cart->delivery->price; |
|
39 | + } |
|
40 | + } |
|
41 | + foreach ($cart->extras as $extra) { |
|
42 | + $currency_id = $extra->currency ? $extra->currency->id : \App::$cur->ecommerce->config['defaultCurrency']; |
|
43 | + if (empty($sums[$currency_id])) { |
|
44 | + $sums[$currency_id] = $extra->price * $extra->count; |
|
45 | + } else { |
|
46 | + $sums[$currency_id] += $extra->price * $extra->count; |
|
47 | + } |
|
48 | + } |
|
49 | + ?> |
|
50 | 50 | <tr> |
51 | 51 | <td class="text-right"><?= $prefix ?><?= $cart->id; ?></td> |
52 | 52 | <td class="text-left"><?= $cart->status ? $cart->status->name : 'Наполняется'; ?></td> |
53 | 53 | <td class="text-right"><?= count($cart->cartItems); ?></td> |
54 | 54 | <td class="text-right"><?php |
55 | - if ($sums) { |
|
56 | - foreach ($sums as $currency_id => $sum) { |
|
57 | - if (!$sum) { |
|
58 | - continue; |
|
59 | - } |
|
60 | - echo number_format($sum, 2, '.', ' '); |
|
61 | - if (App::$cur->money) { |
|
62 | - $currency = Money\Currency::get($currency_id); |
|
63 | - if ($currency) { |
|
64 | - echo ' ' . $currency->acronym(); |
|
65 | - } else { |
|
66 | - echo ' р.'; |
|
67 | - } |
|
68 | - } else { |
|
69 | - echo ' р.'; |
|
70 | - } |
|
71 | - echo '<br />'; |
|
72 | - } |
|
73 | - } |
|
74 | - ?></td> |
|
55 | + if ($sums) { |
|
56 | + foreach ($sums as $currency_id => $sum) { |
|
57 | + if (!$sum) { |
|
58 | + continue; |
|
59 | + } |
|
60 | + echo number_format($sum, 2, '.', ' '); |
|
61 | + if (App::$cur->money) { |
|
62 | + $currency = Money\Currency::get($currency_id); |
|
63 | + if ($currency) { |
|
64 | + echo ' ' . $currency->acronym(); |
|
65 | + } else { |
|
66 | + echo ' р.'; |
|
67 | + } |
|
68 | + } else { |
|
69 | + echo ' р.'; |
|
70 | + } |
|
71 | + echo '<br />'; |
|
72 | + } |
|
73 | + } |
|
74 | + ?></td> |
|
75 | 75 | <td class="text-left"><?= $cart->complete_data; ?></td> |
76 | 76 | <td><?php |
77 | - if ($cart->payed) { |
|
78 | - echo 'Оплачено'; |
|
79 | - } elseif (!App::$cur->money) { |
|
80 | - echo 'Не оплачено'; |
|
81 | - } else { |
|
82 | - $handlers = App::$cur->ecommerce->getSnippets('payTypeHandler'); |
|
83 | - $redirect = ['/ecommerce/cart/success']; |
|
84 | - if ($cart->payType && !empty($handlers[$cart->payType->handler]['handler'])) { |
|
85 | - $newRedirect = $handlers[$cart->payType->handler]['handler']($cart); |
|
86 | - } |
|
87 | - if (!empty($newRedirect[0])) { |
|
88 | - echo '<a class="btn btn-warning btn-sm" href = "' . $newRedirect[0] . '">Оплатить</a>'; |
|
89 | - } else { |
|
90 | - echo 'Не оплачено'; |
|
91 | - } |
|
92 | - } |
|
93 | - ?></td> |
|
77 | + if ($cart->payed) { |
|
78 | + echo 'Оплачено'; |
|
79 | + } elseif (!App::$cur->money) { |
|
80 | + echo 'Не оплачено'; |
|
81 | + } else { |
|
82 | + $handlers = App::$cur->ecommerce->getSnippets('payTypeHandler'); |
|
83 | + $redirect = ['/ecommerce/cart/success']; |
|
84 | + if ($cart->payType && !empty($handlers[$cart->payType->handler]['handler'])) { |
|
85 | + $newRedirect = $handlers[$cart->payType->handler]['handler']($cart); |
|
86 | + } |
|
87 | + if (!empty($newRedirect[0])) { |
|
88 | + echo '<a class="btn btn-warning btn-sm" href = "' . $newRedirect[0] . '">Оплатить</a>'; |
|
89 | + } else { |
|
90 | + echo 'Не оплачено'; |
|
91 | + } |
|
92 | + } |
|
93 | + ?></td> |
|
94 | 94 | <td class="text-right"> |
95 | 95 | <?php |
96 | - if ($cart->cart_status_id < 2) { |
|
97 | - ?> |
|
96 | + if ($cart->cart_status_id < 2) { |
|
97 | + ?> |
|
98 | 98 | <a title="Продолжить покупки" href="/ecommerce/cart/continue/<?= $cart->id; ?>" data-toggle="tooltip" title="" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-chevron-right"></i></a> |
99 | 99 | <a title="Удалить заказ" onclick="return confirm('Вы уверены?')" href="/ecommerce/cart/delete/<?= $cart->id; ?>" data-toggle="tooltip" title="" class="btn btn-danger btn-sm"><i class="glyphicon glyphicon-trash"></i></a> |
100 | 100 | <?php |
@@ -2,24 +2,24 @@ |
||
2 | 2 | <div class="col-md-4"> |
3 | 3 | <ul class="nav nav-pills nav-stacked"> |
4 | 4 | <?php |
5 | - $hiddenId = Tools::randomString(); |
|
6 | - foreach ($payTypes as $payType) { |
|
7 | - if ((!empty($_POST['payType']) && $_POST['payType'] == $payType->id) || ($cart->payType && $payType->id == $cart->payType->id)) { |
|
8 | - $checked = 'checked'; |
|
9 | - } else { |
|
10 | - $checked = ''; |
|
11 | - } |
|
12 | - echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $payType->id . '\';inji.Ecommerce.Cart.calcSum();return false;">'; |
|
13 | - echo $payType->name; |
|
14 | - echo '</a></li>'; |
|
15 | - } |
|
16 | - $form->input('hidden', "payType", '', [ |
|
17 | - 'value' => $cart->paytype_id, |
|
18 | - 'attributes' => [ |
|
19 | - 'id' => $hiddenId |
|
20 | - ], |
|
21 | - ]); |
|
22 | - ?> |
|
5 | + $hiddenId = Tools::randomString(); |
|
6 | + foreach ($payTypes as $payType) { |
|
7 | + if ((!empty($_POST['payType']) && $_POST['payType'] == $payType->id) || ($cart->payType && $payType->id == $cart->payType->id)) { |
|
8 | + $checked = 'checked'; |
|
9 | + } else { |
|
10 | + $checked = ''; |
|
11 | + } |
|
12 | + echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $payType->id . '\';inji.Ecommerce.Cart.calcSum();return false;">'; |
|
13 | + echo $payType->name; |
|
14 | + echo '</a></li>'; |
|
15 | + } |
|
16 | + $form->input('hidden', "payType", '', [ |
|
17 | + 'value' => $cart->paytype_id, |
|
18 | + 'attributes' => [ |
|
19 | + 'id' => $hiddenId |
|
20 | + ], |
|
21 | + ]); |
|
22 | + ?> |
|
23 | 23 | </ul> |
24 | 24 | </div> |
25 | 25 | <div class="col-md-8"> |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <fieldset> |
2 | 2 | <?php |
3 | - if (\Users\User::$cur->id) { |
|
4 | - $userAdds = Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id]]); |
|
5 | - $values = []; |
|
6 | - foreach ($userAdds as $userAdd) { |
|
7 | - $values[$userAdd->id] = $userAdd->values(['array' => true]); |
|
8 | - } |
|
9 | - if ($userAdds) { |
|
10 | - $form->input('select', 'userAddsId', 'Ваши контакты', ['values' => ['' => 'Выберите'] + Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id], 'forSelect' => true])]); |
|
11 | - echo '<hr />'; |
|
12 | - } |
|
13 | - ?> |
|
3 | + if (\Users\User::$cur->id) { |
|
4 | + $userAdds = Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id]]); |
|
5 | + $values = []; |
|
6 | + foreach ($userAdds as $userAdd) { |
|
7 | + $values[$userAdd->id] = $userAdd->values(['array' => true]); |
|
8 | + } |
|
9 | + if ($userAdds) { |
|
10 | + $form->input('select', 'userAddsId', 'Ваши контакты', ['values' => ['' => 'Выберите'] + Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id], 'forSelect' => true])]); |
|
11 | + echo '<hr />'; |
|
12 | + } |
|
13 | + ?> |
|
14 | 14 | <script> |
15 | 15 | var userAddsValues = <?= json_encode($values); ?>; |
16 | 16 | inji.onLoad(function () { |
@@ -14,12 +14,12 @@ |
||
14 | 14 | </td> |
15 | 15 | <td class="text-left"> |
16 | 16 | <?php |
17 | - if (!empty($cartItem->item->options['7fc7a4d1-b26a-11e4-9490-80c16e818121']) && $cartItem->item->options['7fc7a4d1-b26a-11e4-9490-80c16e818121']->cip_value) { |
|
18 | - echo '<div style="min-width:200px;">'; |
|
19 | - $price = $cartItem->price->price; |
|
20 | - $max = $cartItem->price->offer->warehouseCount((!empty($_SESSION['cart']['cart_id']) ? $_SESSION['cart']['cart_id'] : 0)) * 1000; |
|
21 | - $step = preg_replace('![^0-9]!', '', $cartItem->item->options['7fc7a4d1-b26a-11e4-9490-80c16e818121']->cip_value); |
|
22 | - ?> |
|
17 | + if (!empty($cartItem->item->options['7fc7a4d1-b26a-11e4-9490-80c16e818121']) && $cartItem->item->options['7fc7a4d1-b26a-11e4-9490-80c16e818121']->cip_value) { |
|
18 | + echo '<div style="min-width:200px;">'; |
|
19 | + $price = $cartItem->price->price; |
|
20 | + $max = $cartItem->price->offer->warehouseCount((!empty($_SESSION['cart']['cart_id']) ? $_SESSION['cart']['cart_id'] : 0)) * 1000; |
|
21 | + $step = preg_replace('![^0-9]!', '', $cartItem->item->options['7fc7a4d1-b26a-11e4-9490-80c16e818121']->cip_value); |
|
22 | + ?> |
|
23 | 23 | Примерный вес |
24 | 24 | <input name="items[<?php echo $cartItem->id; ?>]" type = "text" class ="combineRanger item-counter cart-couner rangerCount" data-step ="<?= $step; ?>" data-max="<?= $max; ?>" data-price ="<?= $price; ?>" value="<?php echo (float) $cartItem->count * 1000; ?>" /> |
25 | 25 | <?php |
@@ -2,24 +2,24 @@ |
||
2 | 2 | <div class="col-md-4"> |
3 | 3 | <ul class="nav nav-pills nav-stacked"> |
4 | 4 | <?php |
5 | - $hiddenId = Tools::randomString(); |
|
6 | - foreach ($deliverys as $delivery) { |
|
7 | - if ((!empty($_POST['delivery']) && $_POST['delivery'] == $delivery->id) || ($cart->delivery && $delivery->id == $cart->delivery->id)) { |
|
8 | - $checked = 'checked'; |
|
9 | - } else { |
|
10 | - $checked = ''; |
|
11 | - } |
|
12 | - echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $delivery->id . '\';inji.Ecommerce.Cart.calcSum();return false;">'; |
|
13 | - echo $delivery->name; |
|
14 | - echo '</a></li>'; |
|
15 | - } |
|
16 | - $form->input('hidden', "delivery", '', [ |
|
17 | - 'value' => $cart->delivery_id, |
|
18 | - 'attributes' => [ |
|
19 | - 'id' => $hiddenId |
|
20 | - ], |
|
21 | - ]); |
|
22 | - ?> |
|
5 | + $hiddenId = Tools::randomString(); |
|
6 | + foreach ($deliverys as $delivery) { |
|
7 | + if ((!empty($_POST['delivery']) && $_POST['delivery'] == $delivery->id) || ($cart->delivery && $delivery->id == $cart->delivery->id)) { |
|
8 | + $checked = 'checked'; |
|
9 | + } else { |
|
10 | + $checked = ''; |
|
11 | + } |
|
12 | + echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $delivery->id . '\';inji.Ecommerce.Cart.calcSum();return false;">'; |
|
13 | + echo $delivery->name; |
|
14 | + echo '</a></li>'; |
|
15 | + } |
|
16 | + $form->input('hidden', "delivery", '', [ |
|
17 | + 'value' => $cart->delivery_id, |
|
18 | + 'attributes' => [ |
|
19 | + 'id' => $hiddenId |
|
20 | + ], |
|
21 | + ]); |
|
22 | + ?> |
|
23 | 23 | </ul> |
24 | 24 | </div> |
25 | 25 | <div class="col-md-8"> |
@@ -27,7 +27,7 @@ |
||
27 | 27 | if ($cart->delivery) { |
28 | 28 | echo "<h4>Информация о доставке</h4>"; |
29 | 29 | if ($cart->delivery->price_text || $cart->delivery->price) { |
30 | - echo "<div>Стоимость доставки: <b>" . ($cart->delivery->price_text ? $cart->delivery->price_text : ( $cart->delivery->price . ' ' . ($cart->delivery->currency ? $cart->delivery->currency->acronym() : 'руб.') )) . '</b></div>'; |
|
30 | + echo "<div>Стоимость доставки: <b>" . ($cart->delivery->price_text ? $cart->delivery->price_text : ($cart->delivery->price . ' ' . ($cart->delivery->currency ? $cart->delivery->currency->acronym() : 'руб.'))) . '</b></div>'; |
|
31 | 31 | } |
32 | 32 | if ((float) $cart->delivery->max_cart_price) { |
33 | 33 | echo '<div>При заказе товаров на сумму от ' . $cart->delivery->max_cart_price . ' руб - бесплатно</div>'; |
@@ -1,20 +1,20 @@ |
||
1 | 1 | <div class="ecommerce"> |
2 | 2 | <div class="content"> |
3 | 3 | <?php |
4 | - $cart = Ecommerce\Cart::getList([ |
|
5 | - 'where' => [ |
|
6 | - ['user_id', Users\User::$cur->id], |
|
7 | - ], |
|
8 | - 'order' => ['complete_data', 'desc'], |
|
9 | - 'limit' => 1 |
|
10 | - ]); |
|
11 | - $cart_id = isset(array_values($cart)[0]) ? array_values($cart)[0]->id : ''; |
|
12 | - $prefix = isset(App::$cur->ecommerce->config['orderPrefix']) ? $config = App::$cur->ecommerce->config['orderPrefix'] : ''; |
|
13 | - $text = "<p>История заказа находится в <a href='/users/cabinet'>Личном кабинете</a>. Для просмотра истории, перейдите по ссылке <a href=\"/users/cabinet/ecommerceOrdersHistory\">История заказов</a>.</p> |
|
4 | + $cart = Ecommerce\Cart::getList([ |
|
5 | + 'where' => [ |
|
6 | + ['user_id', Users\User::$cur->id], |
|
7 | + ], |
|
8 | + 'order' => ['complete_data', 'desc'], |
|
9 | + 'limit' => 1 |
|
10 | + ]); |
|
11 | + $cart_id = isset(array_values($cart)[0]) ? array_values($cart)[0]->id : ''; |
|
12 | + $prefix = isset(App::$cur->ecommerce->config['orderPrefix']) ? $config = App::$cur->ecommerce->config['orderPrefix'] : ''; |
|
13 | + $text = "<p>История заказа находится в <a href='/users/cabinet'>Личном кабинете</a>. Для просмотра истории, перейдите по ссылке <a href=\"/users/cabinet/ecommerceOrdersHistory\">История заказов</a>.</p> |
|
14 | 14 | <p>Если у Вас возникли вопросы, пожалуйста <a href='/materials/contacts'>свяжитесь с нами</a>.</p>"; |
15 | 15 | |
16 | - if (isset(array_values($cart)[0])) { |
|
17 | - ?> |
|
16 | + if (isset(array_values($cart)[0])) { |
|
17 | + ?> |
|
18 | 18 | <h1 class="heading-title">Ваш заказ номер <?= $prefix; ?><?= $cart_id; ?> принят!</h1> |
19 | 19 | <p>Ваш заказ принят!</p> |
20 | 20 | <?= $text ?> |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | <tr> |
18 | 18 | <td class="text-left" style="width: 50%;"> |
19 | 19 | <?php |
20 | - foreach ($orderDeatilCols as $col => $label) { |
|
21 | - echo "<b>{$label}</b> " . $cart->$col . "<br>"; |
|
22 | - } |
|
23 | - ?> |
|
20 | + foreach ($orderDeatilCols as $col => $label) { |
|
21 | + echo "<b>{$label}</b> " . $cart->$col . "<br>"; |
|
22 | + } |
|
23 | + ?> |
|
24 | 24 | </td> |
25 | 25 | <td class="text-left"> |
26 | 26 | <b>Способ оплаты</b> <?= $cart->payType ? $cart->payType->name : '' ?><br> |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | <tr> |
40 | 40 | <td class="text-left"> |
41 | 41 | <?php |
42 | - if ($cart->infos) { |
|
43 | - foreach ($cart->infos as $info) { |
|
44 | - echo "<b>{$info->field->name()}</b> " . $info->value . "<br>"; |
|
45 | - } |
|
46 | - } |
|
47 | - ?> |
|
42 | + if ($cart->infos) { |
|
43 | + foreach ($cart->infos as $info) { |
|
44 | + echo "<b>{$info->field->name()}</b> " . $info->value . "<br>"; |
|
45 | + } |
|
46 | + } |
|
47 | + ?> |
|
48 | 48 | </td> |
49 | 49 | </tr> |
50 | 50 | </tbody> |
@@ -65,45 +65,45 @@ discard block |
||
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> |
@@ -117,24 +117,24 @@ discard block |
||
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 ' ' . $currency->acronym(); |
|
129 | - } else { |
|
130 | - echo ' руб.'; |
|
131 | - } |
|
132 | - } else { |
|
133 | - echo ' руб.'; |
|
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 ' ' . $currency->acronym(); |
|
129 | + } else { |
|
130 | + echo ' руб.'; |
|
131 | + } |
|
132 | + } else { |
|
133 | + echo ' руб.'; |
|
134 | + } |
|
135 | + echo '<br />'; |
|
136 | + } |
|
137 | + ?></td> |
|
138 | 138 | <td></td> |
139 | 139 | </tr> |
140 | 140 | <?php |
@@ -160,24 +160,24 @@ discard block |
||
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 ' ' . $currency->acronym(); |
|
172 | - } else { |
|
173 | - echo ' руб.'; |
|
174 | - } |
|
175 | - } else { |
|
176 | - echo ' руб.'; |
|
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 ' ' . $currency->acronym(); |
|
172 | + } else { |
|
173 | + echo ' руб.'; |
|
174 | + } |
|
175 | + } else { |
|
176 | + echo ' руб.'; |
|
177 | + } |
|
178 | + echo '<br />'; |
|
179 | + } |
|
180 | + ?></td> |
|
181 | 181 | <td></td> |
182 | 182 | </tr> |
183 | 183 | </tfoot> |
@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | </thead> |
195 | 195 | <tbody> |
196 | 196 | <?php |
197 | - $statuses = Ecommerce\Cart\Event::getList(['where' => [['cart_id', $cart->id]], 'order' => ['date_create', 'desc']]); |
|
198 | - foreach ($statuses as $status) { |
|
199 | - ?> |
|
197 | + $statuses = Ecommerce\Cart\Event::getList(['where' => [['cart_id', $cart->id]], 'order' => ['date_create', 'desc']]); |
|
198 | + foreach ($statuses as $status) { |
|
199 | + ?> |
|
200 | 200 | <tr> |
201 | 201 | <td class="text-left"><?= $status->date_create; ?></td> |
202 | 202 | <td class="text-left"><?= $status->type->name; ?></td> |
@@ -86,14 +86,14 @@ discard block |
||
86 | 86 | </thead> |
87 | 87 | <tbody> |
88 | 88 | <?php |
89 | - if (class_exists('Money\Currency')) { |
|
90 | - $defaultCurrency = Money\Currency::get(\App::$cur->ecommerce->config['defaultCurrency']); |
|
91 | - } else { |
|
92 | - $defaultCurrency = ''; |
|
93 | - } |
|
94 | - foreach ($cart->cartItems as $cartItem) { |
|
95 | - $path = $cartItem->item->image ? $cartItem->item->image->path : '/static/system/images/no-image.png'; |
|
96 | - ?> |
|
89 | + if (class_exists('Money\Currency')) { |
|
90 | + $defaultCurrency = Money\Currency::get(\App::$cur->ecommerce->config['defaultCurrency']); |
|
91 | + } else { |
|
92 | + $defaultCurrency = ''; |
|
93 | + } |
|
94 | + foreach ($cart->cartItems as $cartItem) { |
|
95 | + $path = $cartItem->item->image ? $cartItem->item->image->path : '/static/system/images/no-image.png'; |
|
96 | + ?> |
|
97 | 97 | <tr class="cart_item_id<?= $cartItem->id; ?> item" data-cart_item_id = '<?php echo $cartItem->id; ?>' data-priceam = '<?php echo $cartItem->price->price; ?>' data-item_offer_price_id = '<?php echo $cartItem->price->id; ?>'> |
98 | 98 | <td class="text-center image"> |
99 | 99 | <a href="/ecommerce/view/<?php echo $cartItem->item->id; ?>"> |
@@ -124,8 +124,8 @@ discard block |
||
124 | 124 | </tbody> |
125 | 125 | <tfoot> |
126 | 126 | <?php |
127 | - $colspan = $cart->hasDiscount() ? 5 : 4; |
|
128 | - ?> |
|
127 | + $colspan = $cart->hasDiscount() ? 5 : 4; |
|
128 | + ?> |
|
129 | 129 | <tr class="order_page-sum"> |
130 | 130 | <td colspan="<?= $colspan; ?>" class="text-right">Сумма:</td> |
131 | 131 | <td colspan="2" class="text-right"><?= $cart->itemsSum(); ?></td> |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | <tr class="order_page-deliverySum"> |
145 | 145 | <td colspan="<?= $colspan; ?>" class="text-right"><?= $cart->delivery->name; ?>:</td> |
146 | 146 | <td colspan="2" class="text-right"><?php |
147 | - if ($cart->delivery && $cart->delivery->price_text) { |
|
148 | - echo $cart->delivery->price_text; |
|
149 | - } else { |
|
150 | - echo $cart->deliverySum(); |
|
151 | - } |
|
152 | - ?></td> |
|
147 | + if ($cart->delivery && $cart->delivery->price_text) { |
|
148 | + echo $cart->delivery->price_text; |
|
149 | + } else { |
|
150 | + echo $cart->deliverySum(); |
|
151 | + } |
|
152 | + ?></td> |
|
153 | 153 | </tr> |
154 | 154 | <?php |
155 | 155 | } |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | <div class="clearfix"></div> |
166 | 166 | <div class="order_page-finish"> |
167 | 167 | <?php |
168 | - $form->input('textarea', 'comment', 'Вы можете добавить комментарий к своему заказу', ['value' => (!empty($_POST['comment'])) ? $_POST['comment'] : '']); |
|
169 | - ?> |
|
168 | + $form->input('textarea', 'comment', 'Вы можете добавить комментарий к своему заказу', ['value' => (!empty($_POST['comment'])) ? $_POST['comment'] : '']); |
|
169 | + ?> |
|
170 | 170 | <div class="order_page-orderBtn"> |
171 | 171 | <button name ="action" value ="order" data-loading-text="Подождите.." class="btn btn-primary">Подтверждение заказа</button> |
172 | 172 | </div> |
@@ -3,9 +3,9 @@ |
||
3 | 3 | <div class="cart-order_page"> |
4 | 4 | <h2>Быстрое оформление заказа</h2> |
5 | 5 | <?php |
6 | - if (!$cart || !$cart->cartItems) |
|
7 | - echo "<h1>Ваша корзина пуста</h1>"; |
|
8 | - else { |
|
6 | + if (!$cart || !$cart->cartItems) { |
|
7 | + echo "<h1>Ваша корзина пуста</h1>"; |
|
8 | + } else { |
|
9 | 9 | $form = new Ui\Form; |
10 | 10 | $form->action = "/ecommerce/cart"; |
11 | 11 | $form->begin(); |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <div class="ecommerce"> |
2 | 2 | <div class="cart-order_page"> |
3 | 3 | <?php |
4 | - $form = new Ui\Form; |
|
5 | - $form->action = "/ecommerce/buyCard"; |
|
6 | - $form->begin(); |
|
7 | - ?> |
|
4 | + $form = new Ui\Form; |
|
5 | + $form->action = "/ecommerce/buyCard"; |
|
6 | + $form->begin(); |
|
7 | + ?> |
|
8 | 8 | <div class="row"> |
9 | 9 | <div class="col-sm-4"> |
10 | 10 | <div class="order_page-info"> |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | </thead> |
35 | 35 | <tbody class="cartitems"> |
36 | 36 | <?php |
37 | - $first = true; |
|
38 | - foreach (\Ecommerce\Card::getList() as $card) { |
|
39 | - $checked = $first; |
|
40 | - $first = false; |
|
41 | - ?> |
|
37 | + $first = true; |
|
38 | + foreach (\Ecommerce\Card::getList() as $card) { |
|
39 | + $checked = $first; |
|
40 | + $first = false; |
|
41 | + ?> |
|
42 | 42 | <tr> |
43 | 43 | <td> |
44 | 44 | <input id ="cardId" type="radio" name ="card_id" value ="<?= $card->id; ?>" <?= $checked ? 'checked' : ''; ?> /> |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | <td> |
51 | 51 | <ul> |
52 | 52 | <?php |
53 | - foreach ($card->levels as $level) { |
|
54 | - ?> |
|
53 | + foreach ($card->levels as $level) { |
|
54 | + ?> |
|
55 | 55 | <li><?= $level->name; ?> - <?= $level->discount->name; ?></li> |
56 | 56 | <?php |
57 | 57 | } |