Commit b15fac82641fb9d8608898468edf347ef9d38937
1 parent
2c4d173e
No-photo for categories-menu
Showing
1 changed file
with
14 additions
and
2 deletions
Show diff stats
common/modules/product/widgets/views/submenu.php
| @@ -8,7 +8,13 @@ | @@ -8,7 +8,13 @@ | ||
| 8 | <div class="content_items"> | 8 | <div class="content_items"> |
| 9 | <?php foreach($populary as $_item) :?> | 9 | <?php foreach($populary as $_item) :?> |
| 10 | <div class="content_item"><a href="<?= \yii\helpers\Url::to(['catalog/category', 'alias' => $_item->alias])?>"> | 10 | <div class="content_item"><a href="<?= \yii\helpers\Url::to(['catalog/category', 'alias' => $_item->alias])?>"> |
| 11 | - <div valign="top" class="picture"><img valign="top" src="<?= $_item->image?>"></div> | 11 | + <div valign="top" class="picture"> |
| 12 | + <?php if (empty($_item->image)) :?> | ||
| 13 | + <img valign="top" src="/images/no_photo.png"> | ||
| 14 | + <?php else :?> | ||
| 15 | + <img valign="top" src="<?= $_item->image?>"> | ||
| 16 | + <?php endif?> | ||
| 17 | + </div> | ||
| 12 | <div class="title"><?= $_item->name?></div> | 18 | <div class="title"><?= $_item->name?></div> |
| 13 | </a></div> | 19 | </a></div> |
| 14 | <?php endforeach?> | 20 | <?php endforeach?> |
| @@ -24,7 +30,13 @@ | @@ -24,7 +30,13 @@ | ||
| 24 | <div class="content_items"> | 30 | <div class="content_items"> |
| 25 | <?php foreach($item['children'] as $_item) :?> | 31 | <?php foreach($item['children'] as $_item) :?> |
| 26 | <div class="content_item"><a href="<?= \yii\helpers\Url::to(['/catalog/category', 'alias' => $_item['item']->alias])?>"> | 32 | <div class="content_item"><a href="<?= \yii\helpers\Url::to(['/catalog/category', 'alias' => $_item['item']->alias])?>"> |
| 27 | - <div valign="top" class="picture"><img valign="top" src="<?= $_item['item']->image?>"></div> | 33 | + <div valign="top" class="picture"> |
| 34 | + <?php if (empty($_item['item']->image)) :?> | ||
| 35 | + <img valign="top" src="/images/no_photo.png"> | ||
| 36 | + <?php else :?> | ||
| 37 | + <img valign="top" src="<?= $_item['item']->image?>" alt="<?= $_item['item']->name?>"> | ||
| 38 | + <?php endif?> | ||
| 39 | + </div> | ||
| 28 | <div class="title"><?= $_item['item']->name?></div> | 40 | <div class="title"><?= $_item['item']->name?></div> |
| 29 | </a></div> | 41 | </a></div> |
| 30 | <?php endforeach?> | 42 | <?php endforeach?> |