= Seo::widget([ 'row'=>'h1'])?>
= ucfirst ( strtolower (Seo::widget([ 'row'=>'h1'])))?>
UAH
= $priceLimits['min'] ?>
diff --git a/frontend/widgets/Seo.php b/frontend/widgets/Seo.php
index 1037911..83cf33a 100755
--- a/frontend/widgets/Seo.php
+++ b/frontend/widgets/Seo.php
@@ -27,6 +27,7 @@ class Seo extends Widget
public $key;
public $name;
public $project_name;
+ public static $optionsList;
protected static $check_url;
protected static $check_url_bool;
@@ -41,6 +42,10 @@ class Seo extends Widget
{
$this->url = \Yii::$app->request->url;
$this->project_name = \Yii::$app->name;
+ if(empty(self::$optionsList)){
+ self::$optionsList = ArrayHelper::getColumn(TaxGroup::find()->where(['is_filter' => 'TRUE'])->all(),'alias');
+ }
+
parent::init();
}
@@ -50,6 +55,8 @@ class Seo extends Widget
{
$seoData = $this->getViewData();
+
+
foreach ($seoData as $key => $value) {
$this->$key = $value;
}
@@ -109,7 +116,7 @@ class Seo extends Widget
} else {
if($this->selectSeoData(self::H1) == $this->category_name) {
- return ucfirst ( strtolower ($this->selectSeoData(self::H1) . ' ' . $model->name ));
+ return $this->selectSeoData(self::H1) . ' ' . $model->name ;
}else {
return $this->selectSeoData(self::H1);
@@ -128,7 +135,7 @@ class Seo extends Widget
} else {
if($this->selectSeoData(self::H1) == $this->category_name) {
- return ucfirst ( strtolower ($this->selectSeoData(self::H1) . ' ' . $model->value->value));
+ return $this->selectSeoData(self::H1) . ' ' . $model->value->value;
}else {
return $this->selectSeoData(self::H1);
@@ -170,10 +177,8 @@ class Seo extends Widget
}
- $optionsList = ArrayHelper::getColumn(TaxGroup::find()->where(['is_filter' => 'TRUE'])->all(),'alias');
-
- foreach($optionsList as $optionList){
+ foreach(self::$optionsList as $optionList){
if (isset($filter[$optionList]) && count($filter[$optionList]) == 1) {
@@ -259,10 +264,7 @@ class Seo extends Widget
]);
} else if (
- isset($filter['brands']) && count($filter['brands']) > 1
- || isset($filter["pol"]) && count($filter["pol"]) > 1
- || isset($filter["naznacenie"]) && count($filter["naznacenie"]) > 1
- || isset($filter["god"]) && count($filter["god"]) > 1
+ isset($filter['brands']) && count($filter['brands']) > 1 || isset($filter) && $this->checkFilter($filter)
) {
$this->getView()->registerMetaTag([
@@ -272,7 +274,7 @@ class Seo extends Widget
} else if (
isset($filter['brands']) && count($filter['brands']) <= 1 && isset($filter) && count($filter, COUNT_RECURSIVE) >= 4
- || isset($filter) && count($filter, COUNT_RECURSIVE) > 4
+ || isset($filter) && count($filter, COUNT_RECURSIVE) >1
|| !empty($sort) || !empty($paginate) || isset($filter['prices'])
) {
$this->getView()->registerMetaTag([
@@ -296,6 +298,18 @@ class Seo extends Widget
}
+
+
+ protected function checkFilter($filter){
+ $status = false;
+ foreach(self::$optionsList as $optionList){
+
+ $status = isset($filter[$optionList]) && count($filter[$optionList]) > 1;
+
+ }
+ return $status;
+ }
+
protected function replaceData($str)
{
@@ -373,7 +387,7 @@ class Seo extends Widget
}
- return ucfirst ( strtolower ( $this->replaceData($result) ) );
+ return $this->replaceData($result);
}
--
libgit2 0.21.4