Commit dc6809dc31456a8a8b26098752288c950c5b2b66
1 parent
9d539ac3
23.06.16
Showing
1 changed file
with
37 additions
and
1 deletions
Show diff stats
frontend/widgets/Seo.php
| ... | ... | @@ -81,7 +81,43 @@ class Seo extends Widget |
| 81 | 81 | // return $filter_row; |
| 82 | 82 | // } |
| 83 | 83 | |
| 84 | - if (!empty($title)) { | |
| 84 | + if(!empty($filter)) { | |
| 85 | + | |
| 86 | + $array = [ | |
| 87 | + 'category' => $this->category_name | |
| 88 | + ]; | |
| 89 | + | |
| 90 | + | |
| 91 | + if (isset($filter['brands']) && count($filter['brands']) == 1) { | |
| 92 | + $model = Brand::find()->where(['alias' => $filter['brands'][0]])->one(); | |
| 93 | + | |
| 94 | + $array['brand'] = $model->name; | |
| 95 | + } | |
| 96 | + | |
| 97 | + if (isset($filter['options']["pol"]) && count($filter['options']["pol"]) == 1) { | |
| 98 | + | |
| 99 | + $model = TaxOption::find()->where(['alias' => $filter['options']["pol"]])->one(); | |
| 100 | + $array['sex'] = $model->value->value; | |
| 101 | + | |
| 102 | + | |
| 103 | + } | |
| 104 | + | |
| 105 | + if (isset($filter['options']["naznacenie"]) && count($filter['options']["naznacenie"]) == 1) { | |
| 106 | + | |
| 107 | + $model = TaxOption::find()->where(['alias' => $filter['options']["naznacenie"]])->one(); | |
| 108 | + $array['naz'] = $model->value->value; | |
| 109 | + | |
| 110 | + } | |
| 111 | + | |
| 112 | + if (isset($filter['options']["god"]) && count($filter['options']["god"]) == 1) { | |
| 113 | + | |
| 114 | + $model = TaxOption::find()->where(['alias' => $filter['options']["god"]])->one(); | |
| 115 | + $array['year'] = $model->value->value; | |
| 116 | + | |
| 117 | + } | |
| 118 | + return $this->getTitleString($array); | |
| 119 | + | |
| 120 | + } else if (!empty($title)) { | |
| 85 | 121 | return $title; |
| 86 | 122 | } else { |
| 87 | 123 | return $this->project_name; | ... | ... |