Blame view

frontend/views/product/view.php 2.33 KB
4ca21c3e   Alexey Boroda   first commit
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
  <?php
  /**
   * @var Product $product
   * @var ProductVariant $variant
   * @var View $this
   * @var ProductVariant[] $variants
   */
  use common\components\artboximage\ArtboxImageHelper;
  use common\modules\product\models\Product;
  use common\modules\product\models\ProductVariant;
  use yii\helpers\Html;
  use yii\helpers\Url;
  use yii\web\View;
  use yii\widgets\Pjax;
  
  $this->title = $product->name . ' - ' . $variant->sku;
  $this->params['breadcrumbs'][] = [
      'label' => $product->category->parent->parent->name,
      'url' => Url::to([
          'category/index',
          'id' => $product->category->parent->parent->category_id,
      ]),
  ];
  $this->params['breadcrumbs'][] = [
      'label' => $product->category->parent->name,
      'url' => Url::to([
          'category/brand',
          'id' => $product->category->parent->category_id,
      ]),
  ];
  $this->params['breadcrumbs'][] = [
      'label' => $product->category->name,
      'url' => Url::to([
          'category/collection',
          'id' => $product->category->category_id,
      ]),
  ];
  $this->params['breadcrumbs'][] = $this->title;
  
  ?>
  
  <?php Pjax::begin([
      'id' => 'pjax-reload',
      'timeout' => 5000,
  ]); ?>
  <div class="col-md-12">
      <div class="col-md-8 col-sm-12">
          <div class="pic">
              <?php
              echo ArtboxImageHelper::getImage($variant->getImageUrl(), 'product_main');
              ?>
          </div>
      </div>
      <div class="col-lg-3 col-md-4 col-sm-12 mat-opt-list">
          <div class="name1"><?php echo $product->name; ?></div>
          <div class="name2"><?php echo $product->category->name; ?></div>
          <div class="name3"><?php echo $product->category->parent->name; ?></div>
  
          <ul>
              <li><span>Артикул:</span> <?php echo $variant->sku; ?></li>
              <li><span>Размер:</span> 384 x 300 см</li>
              <li><span>Состав:</span> 100% шелк</li>
          </ul>
      </div>
  </div>
  <div class="col-md-12 mat_pics">
      <?php
      foreach ($variants as $oneVariant) {
          ?>
      <div class="col-md-2 col-sm-3 col-xs-4 mat_pic">
          <?php
          echo Html::a(ArtboxImageHelper::getImage($oneVariant->getImageUrl(), 'product_variant_main'), [
              'product/view',
              'product_id' => $product->product_id,
              'variant_id' => $oneVariant->product_variant_id,
          ]);
          ?>
      </div>
      <?php } ?>
  </div>
  <?php Pjax::end(); ?>