From dc6809dc31456a8a8b26098752288c950c5b2b66 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 23 Jun 2016 12:57:09 +0300 Subject: [PATCH] 23.06.16 --- frontend/widgets/Seo.php | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/frontend/widgets/Seo.php b/frontend/widgets/Seo.php index 0c1d64f..0848c41 100755 --- a/frontend/widgets/Seo.php +++ b/frontend/widgets/Seo.php @@ -81,7 +81,43 @@ class Seo extends Widget // return $filter_row; // } - if (!empty($title)) { + if(!empty($filter)) { + + $array = [ + 'category' => $this->category_name + ]; + + + if (isset($filter['brands']) && count($filter['brands']) == 1) { + $model = Brand::find()->where(['alias' => $filter['brands'][0]])->one(); + + $array['brand'] = $model->name; + } + + if (isset($filter['options']["pol"]) && count($filter['options']["pol"]) == 1) { + + $model = TaxOption::find()->where(['alias' => $filter['options']["pol"]])->one(); + $array['sex'] = $model->value->value; + + + } + + if (isset($filter['options']["naznacenie"]) && count($filter['options']["naznacenie"]) == 1) { + + $model = TaxOption::find()->where(['alias' => $filter['options']["naznacenie"]])->one(); + $array['naz'] = $model->value->value; + + } + + if (isset($filter['options']["god"]) && count($filter['options']["god"]) == 1) { + + $model = TaxOption::find()->where(['alias' => $filter['options']["god"]])->one(); + $array['year'] = $model->value->value; + + } + return $this->getTitleString($array); + + } else if (!empty($title)) { return $title; } else { return $this->project_name; -- libgit2 0.21.4