_order_form.php
7.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
use common\models\Orders;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
?>
<table border="0" cellspacing="1" cellpadding="2" align="center" style="cursor:default; width: 100%;">
<tbody>
<tr>
<td>
<table border="0" cellspacing="0" cellpadding="5" id="tbl_cart" class="tbl_cart">
<tbody><tr class="buttonsPanel topButtonsBox">
<td class="returnBtnCell" style="width: 220px;">
<div style="float: left;">
<button name="submit_button" type="submit" class="btn btn-large" id="submit_button" data-toggle="modal" data-target="#myForm" onclick="return false;">Оформить заказ</button>
</div>
</td>
<td class="confirmBtnCell">
<div style="float: left;">
<button name="" type="button" class="btn btn-large return" id="" onclick="return location.href='javascript:history.back();';">
Вернуться к покупкам
</button> </div>
</td>
</tr>
</tbody></table>
<?php
foreach($models as $model) {
$item = $basket->getItem($model->product_variant_id);
?>
<div class="order_item item_container" data-id="<?php echo $model->product_variant_id; ?>" >
<table border="0" cellspacing="0" cellpadding="5" id="tbl_cart" class="tbl_cart">
<tbody><tr valign="top" id="ord_row_539" class="itemRow">
<td rowspan="2" class="order_img">
<a target="_blank" href="<?= Url::to([
'catalog/product',
'product' => $model->product->alias
]) ?>">
<div class="imgBorder">
<?php
echo \common\components\artboximage\ArtboxImageHelper::getImage($model->getImageUrl(), 'list');
?>
</div>
</a>
</td>
<td class="iTitle" style="width: 450px;">
<a target="_blank" href="<?= Url::to([
'catalog/product',
'product' => $model->product->alias
]) ?>">
<?= $model->getFullname() ?>
</a>
</td>
<td style=" vertical-align: top;">
<table class="order_details">
<tbody>
<tr>
<td colspan="2">
<a class="del_order cart_remove" lang="539" title="Удалить товар">удалить товар <span>x</span></a>
</td>
</tr>
<tr>
<td>
Цена
</td>
<td>
<div class="iPriceOne">
<label class="price"><span><?= $item['price']?></span> грн.</label>
</div>
</td>
</tr>
<tr >
<td>
Количество
</td>
<td>
<div class="count_choise">
<span class="minus"></span>
<input type="text" value="<?= $item['count']?>" class="small qtyInput prod_count" >
<span class="plus"></span>
</div>
</td>
</tr>
<tr>
<td>
Cумма
</td>
<td>
<div class="iPrice">
<label id="cost" class="total_prod cost"><span><?= $item['count'] * $item['price']; ?></span> грн.</label> <!-- 00 коп.-->
</div>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody></table>
</div>
<?php
}
?>
<table border="0" cellspacing="0" cellpadding="5" id="tbl_cart" class="tbl_cart">
<tbody>
<tr valign="bottom" class="totalPrice" style="text-align: right;">
<td colspan="2" align="right"> </td>
<td>
<span class="total_summ_name">Сумма заказа:</span>
<label id="total" class="cart_total"><span><?php echo $basket->getSum(); ?></span> грн.</label>
</td>
</tr>
<tr>
<td colspan="6">
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<div class="modal fade" id="myForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog buy-product" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<?php $form = ActiveForm::begin(['action'=>['/order/save'],'id'=>'orderForm']); ?>
<?= $form->field(new Orders(), 'name')->textInput() ?>
<?= $form->field(new Orders(), 'phone')->textInput() ?>
<?= $form->field(new Orders(), 'email') ?>
<?= $form->field(new Orders(), 'comment')->textarea() ?>
<button type="submit" class="pull-right btn btn-large btn-default">Оформить</button>
<?php ActiveForm::end(); ?>
<div class="clearfix"></div>
<p><span style="color: red;">*</span> - обязательные поля для ввода</p>
</div>
</div>
</div>
</div>