diff --git a/frontend/controllers/CategoryController.php b/frontend/controllers/CategoryController.php
index c026b9e..0358809 100755
--- a/frontend/controllers/CategoryController.php
+++ b/frontend/controllers/CategoryController.php
@@ -1,6 +1,7 @@
findModel($id);
/**
* @var SeoComponent $seo
+ * @var FilterHelper $filterHelper
*/
$seo = Yii::$app->get('seo');
$seo->setModel($model->lang);
@@ -39,7 +41,10 @@
$query = $filterHelper->buildQuery();
$dataProvider = new ActiveDataProvider(
[
- 'query' => $query,
+ 'query' => $query,
+ 'pagination' => [
+ 'pageSize' => 18,
+ ],
]
);
@@ -70,7 +75,7 @@
* @var Page $model
*/
$model = Category::findWithFilters($id)
- ->with('lang')
+ ->with('lang.alias')
->with('categories.lang')
->with(
[
@@ -83,6 +88,7 @@
]
)
->one();
+ $seo->setAlias($model->lang->alias);
if (!empty( $model )) {
if ($model->lang->alias_id !== $seo->aliasId) {
throw new NotFoundHttpException('Wrong language');
diff --git a/frontend/views/category/_product_item.php b/frontend/views/category/_product_item.php
new file mode 100644
index 0000000..5eb314c
--- /dev/null
+++ b/frontend/views/category/_product_item.php
@@ -0,0 +1,96 @@
+get('imagemanager');
+?>
+
@@ -113,7 +118,10 @@ _________________________________________________________ -->
'id' => $model->id,
'filter' => $filterHelper->buildLink($brand),
]
- )
+ ),
+ [
+ 'class' => $filterHelper->has($brand->lang->alias->value) ? 'active' : '',
+ ]
);
}
?>
@@ -144,7 +152,12 @@ _________________________________________________________ -->
'id' => $model->id,
'filter' => $filterHelper->buildLink($option),
]
- )
+ ),
+ [
+ 'class' => $filterHelper->has(
+ $option->lang->alias->value
+ ) ? 'active' : '',
+ ]
);
}
?>
@@ -175,7 +188,12 @@ _________________________________________________________ -->
'id' => $model->id,
'filter' => $filterHelper->buildLink($option),
]
- )
+ ),
+ [
+ 'class' => $filterHelper->has(
+ $option->lang->alias->value
+ ) ? 'active' : '',
+ ]
);
}
?>
@@ -206,7 +224,12 @@ _________________________________________________________ -->
'id' => $model->id,
'filter' => $filterHelper->buildLink($option),
]
- )
+ ),
+ [
+ 'class' => $filterHelper->has(
+ $option->lang->alias->value
+ ) ? 'active' : '',
+ ]
);
}
?>
@@ -237,7 +260,12 @@ _________________________________________________________ -->
'id' => $model->id,
'filter' => $filterHelper->buildLink($option),
]
- )
+ ),
+ [
+ 'class' => $filterHelper->has(
+ $option->lang->alias->value
+ ) ? 'active' : '',
+ ]
);
}
?>
@@ -261,474 +289,43 @@ _________________________________________________________ -->
_________________________________________________________ -->
-
-
-
-
-
-
-
-
-
-
-
-
- $280
- $143.00
-
-
- В корзину
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
$143.00
-
- В корзину
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $280
- $143.00
-
-
- В корзину
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
$143.00
-
- В корзину
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $280
- $143.00
-
-
- В корзину
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
$143.00
-
- В корзину
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ [
+ 'class' => 'row products',
+ ],
+ 'itemOptions' => [
+ 'tag' => false,
+ ],
+ 'layout' => '{items}',
+ 'dataProvider' => $dataProvider,
+ 'itemView' => function ($model) use ($view) {
+ /**
+ * @var Product $model
+ */
+ return $view->render(
+ '_product_item',
+ [
+ 'product' => $model,
+ ]
+ );
+ },
+ ]
+ );
+ echo Html::tag(
+ 'div',
+ LinkPager::widget(
+ [
+ 'pagination' => $dataProvider->pagination,
+ ]
+ ),
+ [
+ 'class' => 'pages',
+ ]
+ );
+ ?>
diff --git a/frontend/views/site/_slider_product.php b/frontend/views/site/_slider_product.php
index 99ef772..92d10fc 100644
--- a/frontend/views/site/_slider_product.php
+++ b/frontend/views/site/_slider_product.php
@@ -22,7 +22,7 @@
}
echo Html::a(
Html::img(
- $image ? $imageManager->getImagePath($image) : '/no-image.png',
+ $image ? $imageManager->getImagePath($image) : '/img/no-image.png',
[
'class' => 'img-responsive-image1',
]
diff --git a/frontend/web/css/style.css b/frontend/web/css/style.css
index 97ded00..a51b177 100644
--- a/frontend/web/css/style.css
+++ b/frontend/web/css/style.css
@@ -2806,6 +2806,10 @@ p.no-margin {
.products {
content: " ";
display: table;
+
+}
+
+.row.products {
width: 100%;
}
@@ -2827,6 +2831,7 @@ p.no-margin {
-webkit-transition: all 0.2s ease-out;
-moz-transition: all 0.2s ease-out;
transition: all 0.2s ease-out;
+ max-width: 100%;
}
.product-video {
--
libgit2 0.21.4