Commit 9dcd66fc9ae87d10017ac1ac1e682855ac52ab55
1 parent
8ccb4b63
big commti
Showing
2 changed files
with
12 additions
and
3 deletions
Show diff stats
backend/views/seo-category/index.php
@@ -47,10 +47,10 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -47,10 +47,10 @@ $this->params['breadcrumbs'][] = $this->title; | ||
47 | 'image' => function ($url, $model) | 47 | 'image' => function ($url, $model) |
48 | { | 48 | { |
49 | return Html::a ( | 49 | return Html::a ( |
50 | - '<span class="glyphicon glyphicon-picture"></span>', | 50 | + '<span class="glyphicon glyphicon-list"></span>', |
51 | Url::toRoute(['seo-dynamic/index', 'seo_category_id' => $model->seo_category_id]), | 51 | Url::toRoute(['seo-dynamic/index', 'seo_category_id' => $model->seo_category_id]), |
52 | [ | 52 | [ |
53 | - 'title' => "слайды", | 53 | + 'title' => "Список", |
54 | ] | 54 | ] |
55 | ); | 55 | ); |
56 | }, | 56 | }, |
frontend/controllers/CatalogController.php
@@ -155,9 +155,18 @@ class CatalogController extends \yii\web\Controller | @@ -155,9 +155,18 @@ class CatalogController extends \yii\web\Controller | ||
155 | 155 | ||
156 | ProductHelper::addLastProsucts($product->product_id); | 156 | ProductHelper::addLastProsucts($product->product_id); |
157 | 157 | ||
158 | + $category = null; | ||
159 | + $last_category_id = ProductHelper::getLastCategory(); | ||
160 | + if(!empty($last_category_id)) { | ||
161 | + $category = $product->getCategory()->andWhere(['category_id' => $last_category_id])->one(); | ||
162 | + } | ||
163 | + if(empty($category)) { | ||
164 | + $category = $product->category; | ||
165 | + } | ||
166 | + | ||
158 | return $this->render('product', [ | 167 | return $this->render('product', [ |
159 | 'product' => $product, | 168 | 'product' => $product, |
160 | - 'category' => $product->category, | 169 | + 'category' => $category, |
161 | ]); | 170 | ]); |
162 | } | 171 | } |
163 | 172 |