Blame view

frontend/views/search/index.php 2.74 KB
055ecc3b   Karnovsky A   Karnovsky 11052016
1
2
3
4
5
6
7
8
9
10
11
12
  <?php
  /** @var $this \yii\web\View */
  /** @var $productProvider \yii\data\ActiveDataProvider */
  /** @var $brandProvider \yii\data\ActiveDataProvider */
  
  
  use yii\helpers\Url;
  use common\modules\product\helpers\ProductHelper;
  
  $page_data = [
      'keywords' => implode(' ', $keywords),
  ];
595ed8b5   Administrator   rm node nodule
13
  $this->params['seo']['title'] = 'Поиск';
8724ec1f   Karnovsky A   -
14
  $this->params['breadcrumbs'][] = ['label' => 'Поиск', 'url' => ['catalog/category', 'word' => implode(' ', $keywords)]];
055ecc3b   Karnovsky A   Karnovsky 11052016
15
  
055ecc3b   Karnovsky A   Karnovsky 11052016
16
  
8724ec1f   Karnovsky A   -
17
18
19
20
  //$this->params['seo']['seo_text'] = 'TEST SEO TEXT';
  //$this->params['seo']['h1'] = 'TEST H1';
  //$this->params['seo']['description'] = 'TEST DESCRIPTION';
  //$this->params['seo']['fields']['name'] = 'TEST NAME FROM FIELD';
0f852b51   Administrator   29.06.16
21
  $this->params['seo']['meta']= 'noindex,follow';
055ecc3b   Karnovsky A   Karnovsky 11052016
22
  ?>
055ecc3b   Karnovsky A   Karnovsky 11052016
23
  
8724ec1f   Karnovsky A   -
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  <div class="loyout">
      <?php if(!empty($categories)) :?>
      <div class="leftbar">
          <form action="#" name="filter_catalog_page_form" class="filter-catalog-form">
              <div class="filters">
                  <div class="begin">Категории</div>
                  <ul>
                      <?php foreach ($categories as $_category) :
                          $checked = !empty($category) && $category->category_id == $_category->category_id;
                          $option_url = $checked ? Url::to(['catalog/category', 'word' => implode(' ', $keywords)]) : Url::to(['catalog/category', 'category' => $_category, 'word' => implode(' ', $keywords)]);
                          ?>
                          <li>
                              <input type="checkbox" class="brands-option" <?= $checked ? ' checked' : ''?> onchange="document.location='<?= $option_url?>'" />
                              <a href="<?= $option_url?>"><?= $_category->name?><?php // @todo count?></a>
                          </li>
                      <?php endforeach?>
                  </ul>
055ecc3b   Karnovsky A   Karnovsky 11052016
41
              </div>
8724ec1f   Karnovsky A   -
42
43
          </form>
      </div>
1b898c16   Administrator   20.07.16
44
      <?php endif ?>
8724ec1f   Karnovsky A   -
45
      <div class="content">
b554eb87   Administrator   rm node nodule
46
          <h1>Поиск <?= isset($keywords[0]) ? $keywords[0] : '' ?></h1>
8724ec1f   Karnovsky A   -
47
48
49
          <div class="ten"></div>
          <div class="products pn">
              <ul>
63fbf03d   Administrator   rm node nodule
50
51
52
53
54
55
56
57
                  <?php foreach($productProvider->models as $product) :
                      if(isset($product->variant)){
                  ?>
                  <?= $this->render('product_item.php', ['product' => $product])?>
  
                  <?php
                      }
                   endforeach?>
8724ec1f   Karnovsky A   -
58
59
60
              </ul>
              <div class="both"></div>
          </div>
e4cea6a9   Administrator   rm node nodule
61
62
63
64
65
66
67
68
          <?php if ($productProvider->totalCount > $productProvider->pagination->pageSize) :?>
              <?= \yii\widgets\LinkPager::widget([
                  'pagination' => $productProvider->pagination,
                  'options' => ['class' => 'pagination pull-right'],
                  'registerLinkTags' => true,
              ]);
              ?>
          <?php endif?>
055ecc3b   Karnovsky A   Karnovsky 11052016
69
      </div>
055ecc3b   Karnovsky A   Karnovsky 11052016
70
  </div>