Commit 4b4be5ead70a22ac7618f39f8828e72177f7ca6f
1 parent
bce880f4
29.06.16
Showing
1 changed file
with
13 additions
and
14 deletions
Show diff stats
frontend/widgets/Seo.php
... | ... | @@ -94,29 +94,28 @@ class Seo extends Widget |
94 | 94 | |
95 | 95 | |
96 | 96 | |
97 | - if (isset($filter['brands']) && count($filter['brands']) == 1) { | |
98 | - $model = Brand::find()->where(['alias' => $filter['brands'][0]])->one(); | |
99 | - return $this->selectSeoData(self::H1) ? $this->selectSeoData(self::H1) : $model->name; | |
97 | + if (isset($filter['brands']) && count($filter['brands']) == 1) { | |
100 | 98 | |
99 | + $model = Brand::find()->where(['alias' => $filter['brands'][0]])->one(); | |
101 | 100 | |
101 | + if($this->selectSeoData(self::H1) == $this->category_name) { | |
102 | 102 | |
103 | - } | |
104 | - if (isset($filter['options']["naznacenie"]) && count($filter['options']["naznacenie"]) == 1) { | |
103 | + return $this->selectSeoData(self::H1) . ' ' . $model->name; | |
104 | + }else { | |
105 | 105 | |
106 | - $model = TaxOption::find()->where(['alias' => $filter['options']["naznacenie"]])->one(); | |
107 | - if($this->selectSeoData(self::H1) == $this->category_name) { | |
106 | + return $this->selectSeoData(self::H1); | |
108 | 107 | |
109 | - return $this->selectSeoData(self::H1) . ' ' . isset($model->name) ?$model->name : ''; | |
108 | + } | |
110 | 109 | |
111 | - }else { | |
110 | + } else if (isset($filter['options']["naznacenie"]) && count($filter['options']["naznacenie"]) == 1) { | |
112 | 111 | |
113 | - return $this->selectSeoData(self::H1); | |
114 | - } | |
112 | + $model = TaxOption::find()->where(['alias' => $filter['options']["naznacenie"]])->one(); | |
113 | + return $this->selectSeoData(self::H1).' '.$model->value->value; | |
115 | 114 | |
116 | 115 | |
117 | - } else { | |
118 | - return $this->selectSeoData(self::H1); | |
119 | - } | |
116 | + } else { | |
117 | + return $this->selectSeoData(self::H1); | |
118 | + } | |
120 | 119 | break; |
121 | 120 | case self::TITLE: |
122 | 121 | ... | ... |