Blame view

frontend/views/catalog/view.php 2.41 KB
b89bd6a3   Alexey Boroda   26.09.16 filters ...
1
2
3
4
5
6
  <?php
  /**
   * @var Product $product
   * @var ProductVariant $variant
   * @var View $this
   * @var ProductVariant[] $variants
ea8fd6e6   Alexey Boroda   -Product attributes
7
   * @var array $attributes
b89bd6a3   Alexey Boroda   26.09.16 filters ...
8
9
10
11
12
13
14
15
16
   */
  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;
  
4556b430   Alexey Boroda   Changes:
17
  $this->title = $product->name;
b89bd6a3   Alexey Boroda   26.09.16 filters ...
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
  $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,
  ]); ?>
bec7a98b   Eugeny Galkovskiy   123
47
  <div class="col-md-12 product">
b89bd6a3   Alexey Boroda   26.09.16 filters ...
48
49
50
51
52
53
54
55
56
57
58
59
60
61
      <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>
ea8fd6e6   Alexey Boroda   -Product attributes
62
63
64
              <?php foreach($attributes as $group => $options) { ?>
              <li><span><?php echo $group; ?>:</span> <?php echo implode(', ', $options); ?></li>
              <?php } ?>
b89bd6a3   Alexey Boroda   26.09.16 filters ...
65
66
          </ul>
      </div>
209ca557   Eugeny Galkovskiy   123
67
      <div style="clear:both;"></div>
b89bd6a3   Alexey Boroda   26.09.16 filters ...
68
69
70
71
72
73
74
75
  </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'), [
4556b430   Alexey Boroda   Changes:
76
77
78
              'catalog/product',
              'product' => $product->alias,
              'variant' => $oneVariant->sku,
b89bd6a3   Alexey Boroda   26.09.16 filters ...
79
80
81
82
83
84
          ]);
          ?>
      </div>
      <?php } ?>
  </div>
  <?php Pjax::end(); ?>