diff --git a/common/translation/ru/product.php b/common/translation/ru/product.php index c115ddc..4ece346 100755 --- a/common/translation/ru/product.php +++ b/common/translation/ru/product.php @@ -8,4 +8,8 @@ return [ 'Remote ID' => 'ID в 1С', 'Search for "{keywords}"' => 'Поиск по "{keywords}"', 'Search for "{keywords}" in category "{category}"' => 'Поиск по "{keywords}" в категории "{category}"', + 'Promo products' => 'Акционные товары', + 'New products' => 'Новинки', + 'Top products' => 'Популярные', + '' => '', ]; \ No newline at end of file diff --git a/frontend/views/site/index.php b/frontend/views/site/index.php index b3de44e..079c2b7 100755 --- a/frontend/views/site/index.php +++ b/frontend/views/site/index.php @@ -29,7 +29,7 @@ echo BannerWidget::widget(['title' => 'HOME_UNDER_SLIDER_3']); echo ''; ?> -= \frontend\widgets\Rubrics::widget(['wrapper' => 'rubrics'])?> += \frontend\widgets\Rubrics::widget(['wrapper' => 'rubrics', 'includes' => [117,118,119,120,121]])?> = \common\modules\product\widgets\specialProducts::widget(['type' => 'promo'])?> = \common\modules\product\widgets\specialProducts::widget(['type' => 'new'])?> diff --git a/frontend/web/css/style.css b/frontend/web/css/style.css index eaf2c81..8dfa902 100755 --- a/frontend/web/css/style.css +++ b/frontend/web/css/style.css @@ -90,11 +90,11 @@ a.myorders{color:#f75d50} .rubrics ul{list-style:none;margin:0px;padding:0px;} .rubrics ul li{float:left;margin:0px 35px;} .rubrics ul li a{float:left;width:120px;padding-top:130px;text-align:center;text-transform: uppercase;color:#494949;text-decoration:none;font-weight:bold;} -.rubrics ul li.item1 a{background:url('../img/ico1.png') no-repeat;} -.rubrics ul li.item2 a{background:url('../img/ico2.png') no-repeat;} -.rubrics ul li.item3 a{background:url('../img/ico3.png') no-repeat;} -.rubrics ul li.item4 a{background:url('../img/ico4.png') no-repeat;} -.rubrics ul li.item5 a{background:url('../img/ico5.png') no-repeat;} +.rubrics ul li.item_ryukzaki a{background:url('../img/ico1.png') no-repeat;} +.rubrics ul li.item_sumki a{background:url('../img/ico2.png') no-repeat;} +.rubrics ul li.item_chehly a{background:url('../img/ico3.png') no-repeat;} +.rubrics ul li.item_nesessery a{background:url('../img/ico4.png') no-repeat;} +.rubrics ul li.item_koshelki a{background:url('../img/ico5.png') no-repeat;} .products{border-top:1px solid #d2d2d2;padding-bottom:30px;padding-top:20px;} diff --git a/frontend/widgets/Rubrics.php b/frontend/widgets/Rubrics.php index 45383d3..c8d2fe9 100644 --- a/frontend/widgets/Rubrics.php +++ b/frontend/widgets/Rubrics.php @@ -14,9 +14,13 @@ class Rubrics extends Widget { public $wrapper = ''; + public $includes = []; + + private $categories = []; + public function run() { - if (!empty($this->active)) { + if (empty($this->active)) { $this->active = Yii::$app->request->get('category'); } if (!is_object($this->active)) { @@ -26,7 +30,14 @@ class Rubrics extends Widget { $this->active = $this->active->category_id; } $items = []; - foreach (Category::find ()->all () as $category) { + + if (empty($this->categories)) { + $this->categories = Category::find ()->all(); + } + foreach ($this->categories as $category) { + if (!empty($this->includes) && !in_array($category->category_id, $this->includes)) { + continue; + } $items[] = $category;[ 'label' => $category->name , 'url' => Url::to(['catalog/category', 'category' => $category]), diff --git a/frontend/widgets/views/rubrics.php b/frontend/widgets/views/rubrics.php index 546dfde..b5758c0 100644 --- a/frontend/widgets/views/rubrics.php +++ b/frontend/widgets/views/rubrics.php @@ -5,9 +5,8 @@ use yii\widgets\Menu;