Blame view

frontend/views/category/collection.php 3.09 KB
4ca21c3e   Alexey Boroda   first commit
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
      /**
       * @var Product[][] $products
       * @var View        $this
       * @var Category    $category
       */
      use common\components\artboximage\ArtboxImageHelper;
      use common\modules\product\models\Category;
      use common\modules\product\models\Product;
      use yii\web\View;
      use yii\helpers\Url;
      use common\widgets\Seo;
      
      $this->params[ 'seo' ][ Seo::TITLE ] = !empty( $category->meta_title ) ? $category->meta_title : $category->name;
      $this->params[ 'seo' ][ Seo::DESCRIPTION ] = !empty( $category->meta_desc ) ? $category->meta_desc : '';
      $this->params[ 'seo' ][ Seo::SEO_TEXT ] = !empty( $category->seo_text ) ? $category->seo_text : '';
      $this->params[ 'seo' ][ Seo::H1 ] = !empty( $category->h1 ) ? $category->h1 : $category->name;
      $this->params[ 'breadcrumbs' ][] = [
          'label' => $category->parent->parent->name,
          'url'   => Url::to([
              'category/index',
              'id' => $category->parent->parent->category_id,
          ]),
      ];
      $this->params[ 'breadcrumbs' ][] = [
          'label' => $category->parent->name,
          'url'   => Url::to([
              'category/brand',
              'id' => $category->parent->category_id,
          ]),
      ];
      $this->params[ 'breadcrumbs' ][] = $category->name;
4ca21c3e   Alexey Boroda   first commit
33
34
35
36
37
38
  ?>
  
  <div class="col-md-12">
      <div class="collection">
          <div class="head">
              <img src="<?php
f2acc393   Alexey Boroda   -Seo widget integ...
39
                  echo $category->getBrandImageUrl();
4ca21c3e   Alexey Boroda   first commit
40
41
42
43
44
45
              ?>">
          </div>
          <div class="titles">
              <div class="line1"><?php echo $category->name; ?></div>
              <div class="line2"><?php echo $category->first_text; ?></div>
          </div>
f2acc393   Alexey Boroda   -Seo widget integ...
46
          <p><?php echo $category->second_text; ?></p>
4ca21c3e   Alexey Boroda   first commit
47
48
          <div class="cols">
              <?php
f2acc393   Alexey Boroda   -Seo widget integ...
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
                  foreach($products as $products_col) {
                      ?>
                      <div class="col-md-4 col-sm-4 col1">
                          <?php
                              foreach($products_col as $product) {
                                  ?>
                                  <a href="<?php echo Url::to([
                                      'catalog/product',
                                      'product' => $product->alias,
                                      'variant' => $product->variant->sku,
                                  ]); ?>" alt="nabuco">
                                      <div class="label"><span><?php echo $product->name; ?></span>
                                      </div>
                                      <?php echo ArtboxImageHelper::getImage($product->getMainImageUrl(), 'collections_thumb'); ?>
                                  </a>
                              <?php } ?>
                      </div>
4ca21c3e   Alexey Boroda   first commit
66
                  <?php } ?>
4ca21c3e   Alexey Boroda   first commit
67
68
69
              <div style="clear:both;"></div>
          </div>
          <div class="down">
987739f1   Alexey Boroda   -Simple spoiler
70
              <div class="simple-spoiler just-closed" style="height: 50px">
f2acc393   Alexey Boroda   -Seo widget integ...
71
                  <div class="spoiler-inner"><?php echo Seo::widget(['row' => Seo::SEO_TEXT]); ?></div>
987739f1   Alexey Boroda   -Simple spoiler
72
73
74
75
              </div>
              <div class="just-more">
                  <a href="#">Узнать больше</a>
              </div>
4ca21c3e   Alexey Boroda   first commit
76
77
78
          </div>
      </div>
  </div>