categories.php
1.96 KB
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
<?php
/** @var $this \yii\web\View */
/** @var $dataProvider \yii\data\ActiveDataProvider */
$this->title = $category->name;
foreach($category->getParents()->all() as $parent) {
    $this->params['breadcrumbs'][] = ['label' => $parent->name, 'url' => ['catalog/category', 'alias' => $parent->alias]];
}
$this->params['breadcrumbs'][] = $this->title;
?>
<h1 class="category_page_main_title"><?= $this->title ?></h1>
<div class="category_wrap">
    <div class="category_wrap_3_colum"><!-- 3 colons for items ==================================  1rst colum -->
        <?php foreach($category->getAllChildrenTree(2, [], 'categoryName') as $category) :?>
            <div class="wrap">
                <div class="cat_li_cont">
                <?php if (!empty($category['item']->image)) :?>
                    <img src="<?= $category['item']->image?>" alt="<?= $category['item']->name?>">
                <?php else :?>
                    <img src="/images/category/1.png" alt="">
                <?php endif;?>
                    <div class="desc"><?= $category['item']->name?><!-- (133)--></div>
                <?php if(!empty($category['children'])) :?>
                    <span class="arrow"></span>
                <?php endif?>
                </div>
                <?php if(!empty($category['children'])) :?>
                <div class="cat_li_sub_ul">
                    <ul>
                    <?php foreach($category['children'] as $_category) :?>
                        <li><a href="<?= \yii\helpers\Url::to(['catalog/category', 'alias' => $_category['item']->alias])?>"><?= $_category['item']->name?><!-- (18)--></a></li>
                    <?php endforeach?>
                    </ul>
                </div>
                <?php endif?>
            </div>
            <!--    $this->params['breadcrumbs'][] = ['label' => $parent->name, 'url' => ['catalog/category', 'alias' => $parent->alias]];-->
        <?php endforeach?>
    </div><!-- end of 3 colons for items -->
</div>