Blame view

widgets/views/submenu.php 2.44 KB
2f25da09   Yarik   first commit
1
2
3
4
5
  <?php

      /**

       * @var Category $rootCategory

       * @var string   $rootClass

       */

2e22f66f   Yarik   Links fixed
6
      use artweb\artbox\components\artboximage\ArtboxImageHelper;

2f25da09   Yarik   first commit
7
8
9
10
      use artweb\artbox\ecommerce\models\Category;

  

  ?>

  <div class="menu_item">

2e22f66f   Yarik   Links fixed
11
12
13
14
15
16
17
18
      <?= \yii\helpers\Html::a(

          $rootCategory->lang->title,

          [

              'catalog/category',

              'category' => $rootCategory,

          ],

          [ 'class' => 'submenu_button ' . $rootClass ]

      ) ?>

2f25da09   Yarik   first commit
19
20
      <div class="submenu">

          <ul class="categories">

2e22f66f   Yarik   Links fixed
21
              <?php foreach ($items as $item) : ?>

2f25da09   Yarik   first commit
22
23
                  <li class="sub_cat">

                      <span><?= $item[ 'item' ]->title ?></span>

2e22f66f   Yarik   Links fixed
24
                      <?php if (!empty( $item[ 'children' ] )) : ?>

2f25da09   Yarik   first commit
25
26
                          <div class="sub_cat_content">

                              <div class="content_items">

2e22f66f   Yarik   Links fixed
27
28
29
30
31
32
33
                                  <?php foreach ($item[ 'children' ] as $_item) : ?>

                                      <div class="content_item"><a href="<?= \yii\helpers\Url::to(

                                              [

                                                  'catalog/category',

                                                  'category' => $_item[ 'item' ],

                                              ]

                                          ) ?>">

2f25da09   Yarik   first commit
34
                                              <div class="picture">

2e22f66f   Yarik   Links fixed
35
                                                  <?php if (empty( $_item[ 'item' ]->image )) : ?>

2f25da09   Yarik   first commit
36
37
                                                      <img src="/images/no_photo.png">

                                                  <?php else : ?>

2e22f66f   Yarik   Links fixed
38
39
40
41
                                                      <?= $_item[ 'item' ]->imageUrl ? ArtboxImageHelper::getImage(

                                                          $_item[ 'item' ]->imageUrl,

                                                          'mainmenu'

                                                      ) : '' ?>

2f25da09   Yarik   first commit
42
43
44
45
46
47
48
49
50
51
52
53
54
                                                  <?php endif ?>

                                              </div>

                                              <div class="title"><?= $_item[ 'item' ]->title ?></div>

                                          </a></div>

                                  <?php endforeach ?>

                              </div>

                          </div>

                      <?php endif ?>

                  </li>

              <?php endforeach ?>

          </ul>

      </div>

  </div>