Blame view

frontend/views/catalog/view.php 2.98 KB
b89bd6a3   Alexey Boroda   26.09.16 filters ...
1
  <?php
f2acc393   Alexey Boroda   -Seo widget integ...
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
      /**
       * @var Product          $product
       * @var ProductVariant   $variant
       * @var View             $this
       * @var ProductVariant[] $variants
       * @var array            $attributes
       */
      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;
      use common\widgets\Seo;
      
      $this->title = $product->name;
      $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' ][] = $product->name;
      $this->params[ 'seo' ][ Seo::TITLE ] = $product->name;
b89bd6a3   Alexey Boroda   26.09.16 filters ...
42
43
44
45
  
  ?>
  
  <?php Pjax::begin([
f2acc393   Alexey Boroda   -Seo widget integ...
46
      'id'      => 'pjax-reload',
b89bd6a3   Alexey Boroda   26.09.16 filters ...
47
48
      'timeout' => 5000,
  ]); ?>
bec7a98b   Eugeny Galkovskiy   123
49
  <div class="col-md-12 product">
b89bd6a3   Alexey Boroda   26.09.16 filters ...
50
51
52
      <div class="col-md-8 col-sm-12">
          <div class="pic">
              <?php
f2acc393   Alexey Boroda   -Seo widget integ...
53
                  echo ArtboxImageHelper::getImage($variant->getImageUrl(), 'product_main');
b89bd6a3   Alexey Boroda   26.09.16 filters ...
54
55
56
57
58
59
60
              ?>
          </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>
f2acc393   Alexey Boroda   -Seo widget integ...
61
          
b89bd6a3   Alexey Boroda   26.09.16 filters ...
62
63
          <ul>
              <li><span>Артикул:</span> <?php echo $variant->sku; ?></li>
987739f1   Alexey Boroda   -Simple spoiler
64
              <?php
f2acc393   Alexey Boroda   -Seo widget integ...
65
66
67
68
69
70
                  if(!empty( $attributes )) {
                      foreach($attributes as $group => $options) { ?>
                          <li>
                              <span><?php echo $group; ?>:</span> <?php echo implode(', ', $options); ?>
                          </li>
                      <?php }
987739f1   Alexey Boroda   -Simple spoiler
71
72
                  }
              ?>
b89bd6a3   Alexey Boroda   26.09.16 filters ...
73
74
          </ul>
      </div>
209ca557   Eugeny Galkovskiy   123
75
      <div style="clear:both;"></div>
b89bd6a3   Alexey Boroda   26.09.16 filters ...
76
77
78
  </div>
  <div class="col-md-12 mat_pics">
      <?php
f2acc393   Alexey Boroda   -Seo widget integ...
79
80
81
82
83
84
85
86
87
88
89
90
          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'), [
                          'catalog/product',
                          'product' => $product->alias,
                          'variant' => $oneVariant->sku,
                      ]);
                  ?>
              </div>
          <?php } ?>
b89bd6a3   Alexey Boroda   26.09.16 filters ...
91
92
  </div>
  <?php Pjax::end(); ?>