order.php
5.12 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
<?php
use artbox\core\helpers\ImageHelper;
use artbox\order\models\Order;
use yii\helpers\Url;
use yii\web\View;
/**
* @var View $this
* @var Order $order
*/
$this->params[ 'breadcrumbs' ][] = [
'label' => Yii::t('app', 'Orders'),
'url' => [
'account/index',
],
];
$this->params[ 'breadcrumbs' ][] = Yii::t('app', 'Order') . ' № ' . $order->id;
?>
<div id="content">
<div class="container">
<div class="row">
<!-- *** LEFT COLUMN ***
_________________________________________________________ -->
<div class="col-md-9 clearfix" id="customer-order">
<p class="lead"><?= Yii::t('app', 'Order')?> №<?= $order->id ?> <?=Yii::t('app','was moved on')?> <strong><?= date(
'd.m.Y',
$order->created_at
) ?></strong><?php
if (!empty($order->label)) {
?> <?=Yii::t('app','and now is')?>
<strong><?= $order->label->lang->title ?></strong>.<?php } ?></p>
<p class="lead text-muted"><?=Yii::t('app','order_text')?>
<a target="_blank" href="<?= Url::to(
[ 'site/contact' ]
) ?>"><?=Yii::t('app','write to us')?></a>.</p>
<div class="box">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th colspan="2"><?=Yii::t('app','Product')?></th>
<th><?=Yii::t('app','Quantity')?></th>
<th><?=Yii::t('app','Unit price')?></th>
<th><?=Yii::t('app','Total')?></th>
</tr>
</thead>
<tbody>
<?php
$total = 0;
foreach ($order->orderProducts as $product) {
$total += $product->price * $product->count;
?>
<tr>
<td>
<a target="_blank" href="<?= Url::to(
[
'product/view',
'id' => $product->variant->product->id,
]
) ?>">
<?= ImageHelper::set(
$product->variant ? $product->variant->product->image->getPath(
) : '@frontend/web/img/no-image.png'
)
->cropResize(50, 50)
->renderImage(
[
'alt' => $product->variant->product->lang->title,
]
) ?>
</a>
</td>
<td><a target="_blank" href="<?= Url::to(
[
'product/view',
'id' => $product->variant->product->id,
]
) ?>"><?= $product->variant->product->lang->title ?></a>
</td>
<td><?= $product->count ?></td>
<td><?= $product->price ?></td>
<td><?= $product->count * $product->price ?></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr>
<th colspan="4" class="text-right"><?=Yii::t('app','Total')?></th>
<th><?= $total ?></th>
</tr>
</tfoot>
</table>
</div>
<!-- /.table-responsive -->
<div class="row addresses">
<div class="col-sm-6 col-sm-offset-6">
<h3 class="text-uppercase"><?= \Yii::t('app', 'Information') ?></h3>
<p><?= $order->name ?>
<br><?= $order->phone ?>
<br><?= $order->city ?>
<br><?= $order->address ?>
<br><?= $order->payment->lang->title ?>
<br><?= $order->delivery->lang->title ?></p>
</div>
</div>
<!-- /.addresses -->
</div>
<!-- /.box -->
</div>
<!-- /.col-md-9 -->
<!-- *** LEFT COLUMN END *** -->
<!-- *** RIGHT COLUMN ***
_________________________________________________________ -->
<div class="col-md-3">
<!-- *** CUSTOMER MENU ***
_________________________________________________________ -->
<?= $this->render('_menu') ?>
<!-- /.col-md-3 -->
<!-- *** CUSTOMER MENU END *** -->
</div>
<!-- *** RIGHT COLUMN END *** -->
</div>
<!-- /.row -->
</div>
<!-- /.container -->
</div>
<!-- /#content -->