diff --git a/backend/controllers/ArticlesController.php b/backend/controllers/ArticlesController.php
index 270a8e9..d588eff 100755
--- a/backend/controllers/ArticlesController.php
+++ b/backend/controllers/ArticlesController.php
@@ -79,9 +79,7 @@ class ArticlesController extends Controller
{
$model = new Articles();
- if ($model->load(Yii::$app->request->post())) {
-
- $model->save();
+ if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
@@ -101,9 +99,7 @@ class ArticlesController extends Controller
{
$model = $this->findModel($id);
- if ($model->load(Yii::$app->request->post())) {
- $model->save();
-
+ if ($model->load(Yii::$app->request->post()) && $model->save() ) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
diff --git a/common/modules/product/models/Stock.php b/common/modules/product/models/Stock.php
index db3e191..4fa53c3 100755
--- a/common/modules/product/models/Stock.php
+++ b/common/modules/product/models/Stock.php
@@ -14,6 +14,7 @@ use Yii;
*/
class Stock extends \yii\db\ActiveRecord
{
+
/**
* @inheritdoc
*/
@@ -33,6 +34,30 @@ class Stock extends \yii\db\ActiveRecord
];
}
+
+ public function getSiteName(){
+ switch(mb_strtolower($this->name)){
+ case "харьков свет":
+ return 'МАГАЗИН ХАРЬКОВ';
+ break;
+ case "осокорки":
+ return 'МАГАЗИН "ОСОКОРКИ"';
+ break;
+ case "олимп":
+ return 'ТЦ "ОЛИМПИЙСКИЙ"';
+ break;
+ case "магазин":
+ return "МАГАЗИН ГЛУБОЧЕЦКАЯ";
+ break;
+ default:
+ return "На складе";
+ break;
+ }
+ }
+
+
+
+
/**
* @inheritdoc
*/
diff --git a/frontend/views/catalog/product.php b/frontend/views/catalog/product.php
index 3881974..6488725 100755
--- a/frontend/views/catalog/product.php
+++ b/frontend/views/catalog/product.php
@@ -308,13 +308,14 @@ FlipclockAsset::register($this);
variant->stock > 0){?>
Купить
- Нет в наличии
+ Нет в наличии
+
Оплатить
@@ -324,14 +325,8 @@ FlipclockAsset::register($this);
-
@@ -626,4 +621,31 @@ FlipclockAsset::register($this);
-
\ No newline at end of file
+
+
+
+
+
+
+
+
Данный товар есть в наличии в наших розничных магазинах
+
+
+
+ variant->stocks as $stock){?>
+ - = Html::a($stock->siteName, Url::to (['text/index', 'translit' => 'magaziny', '#'=>$stock->stock_id])) ?>
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php
index 4e2f521..cb9f288 100755
--- a/frontend/views/layouts/main.php
+++ b/frontend/views/layouts/main.php
@@ -480,28 +480,7 @@ use common\models\Event;
-
-
-
-
-
-
-
-
Данный товар есть в наличии в наших розничных магазинах
-
-
-
-
-
-
-
-
-
-
+
diff --git a/frontend/web/css/css_header.css b/frontend/web/css/css_header.css
index 05905ff..c780023 100755
--- a/frontend/web/css/css_header.css
+++ b/frontend/web/css/css_header.css
@@ -14565,3 +14565,19 @@ ul.product-special li.promo div{
max-width: 1140px;
overflow: hidden;
}
+.shopsList ul{
+ list-style: none;
+}
+
+#link-B:before {
+ display: block;
+ content: "";
+ height: 55px;
+ margin: -55px 0 0;
+}
+.anchor:before {
+ display: block;
+ content: "";
+ height: 55px;
+ margin: -55px 0 0;
+}
diff --git a/frontend/widgets/Seo.php b/frontend/widgets/Seo.php
index 1caa7fb..def4108 100755
--- a/frontend/widgets/Seo.php
+++ b/frontend/widgets/Seo.php
@@ -103,35 +103,18 @@ class Seo extends Widget
$filter = \Yii::$app->request->get('filters', []);
+ $default = $this->selectSeoData(self::H1);
+ if ($default != $this->{self::H1}) {
+ return $default;
- if (isset($filter['brands']) && count($filter['brands']) == 1) {
-
- $model = Brand::find()->where(['alias' => $filter['brands'][0]])->one();
- if(!$model instanceof Brand){
-
- \Yii::$app->response->redirect(['/site/error'],404);
- } else {
- if($this->selectSeoData(self::H1) == $this->category_name) {
-
- return $this->selectSeoData(self::H1) . ' ' . $model->name;
- }else {
-
- return $this->selectSeoData(self::H1);
-
- }
- }
-
-
-
- } else if ($this->checkFilter($filter)) {
+ } else if($this->checkFilter($filter)){
$array = $this->arrayBuilder($filter);
return $this->getNameString($array);
-
-
- } else {
- return $this->selectSeoData(self::H1);
+ }
+ else {
+ return $default;
}
break;
case self::TITLE:
@@ -343,7 +326,7 @@ class Seo extends Widget
}
- $row = substr($row, 0,-1 );
+ $row = substr($row, 0,-2 );
$row .= " - купить в Киеве, Украине - интернет магазин Лінія Світла";
return $row;
// $template = SeoDynamic::find()->select('title')->where(['param' =>'filters'])->one();
@@ -374,7 +357,7 @@ class Seo extends Widget
}
- $row = substr($row, 0,-1 );
+ $row = substr($row, 0,-2 );
$row .= ". Лінія Світла";
return $row;
@@ -395,7 +378,7 @@ class Seo extends Widget
}
- $row = substr($row, 0,-1 );
+ $row = substr($row, 0,-2 );
return $row;
}
@@ -451,7 +434,7 @@ class Seo extends Widget
protected function checkFilter($filter){
foreach(self::$optionsList as $optionList){
- if(isset($filter[$optionList]) && count($filter[$optionList]) > 1){
+ if(isset($filter[$optionList]) && count($filter[$optionList]) == 1){
return true;
}
--
libgit2 0.21.4