Blame view

frontend/views/account/order.php 5.12 KB
950817c6   Alex Savenko   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
  <?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' ][] = [
10e74468   mzavalniuk   translate to ua r...
14
          'label' => Yii::t('app', 'Orders'),
950817c6   Alex Savenko   first commit
15
16
17
18
          'url'   => [
              'account/index',
          ],
      ];
10e74468   mzavalniuk   translate to ua r...
19
      $this->params[ 'breadcrumbs' ][] = Yii::t('app', 'Order') . ' № ' . $order->id;
950817c6   Alex Savenko   first commit
20
21
22
23
24
25
26
27
28
29
30
31
32
  
  ?>
  
  <div id="content">
    <div class="container">
      
      <div class="row">
        
        <!-- *** LEFT COLUMN ***
  _________________________________________________________ -->
        
        <div class="col-md-9 clearfix" id="customer-order">
          
10e74468   mzavalniuk   translate to ua r...
33
          <p class="lead"><?= Yii::t('app', 'Order')?><?= $order->id ?> <?=Yii::t('app','was moved on')?> <strong><?= date(
950817c6   Alex Savenko   first commit
34
35
36
37
                      'd.m.Y',
                      $order->created_at
                  ) ?></strong><?php
                  if (!empty($order->label)) {
10e74468   mzavalniuk   translate to ua r...
38
                      ?> <?=Yii::t('app','and now is')?>
950817c6   Alex Savenko   first commit
39
                    <strong><?= $order->label->lang->title ?></strong>.<?php } ?></p>
10e74468   mzavalniuk   translate to ua r...
40
          <p class="lead text-muted"><?=Yii::t('app','order_text')?>
950817c6   Alex Savenko   first commit
41
42
            <a target="_blank" href="<?= Url::to(
                [ 'site/contact' ]
10e74468   mzavalniuk   translate to ua r...
43
            ) ?>"><?=Yii::t('app','write to us')?></a>.</p>
950817c6   Alex Savenko   first commit
44
45
46
47
48
49
          
          <div class="box">
            <div class="table-responsive">
              <table class="table">
                <thead>
                  <tr>
10e74468   mzavalniuk   translate to ua r...
50
51
52
53
                    <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>
950817c6   Alex Savenko   first commit
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
                  </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>
10e74468   mzavalniuk   translate to ua r...
97
                    <th colspan="4" class="text-right"><?=Yii::t('app','Total')?></th>
950817c6   Alex Savenko   first commit
98
99
100
101
102
103
104
105
106
107
                    <th><?= $total ?></th>
                  </tr>
                </tfoot>
              </table>
            
            </div>
            <!-- /.table-responsive -->
            
            <div class="row addresses">
              <div class="col-sm-6 col-sm-offset-6">
10e74468   mzavalniuk   translate to ua r...
108
                <h3 class="text-uppercase"><?= \Yii::t('app', 'Information') ?></h3>
950817c6   Alex Savenko   first commit
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
                <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 -->