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'); +?> +
+
+
+ images )) { + $image = $product->images[ 0 ]->id; + } else { + $image = null; + } + echo Html::a( + Html::img( + $image ? $imageManager->getImagePath($image) : '/img/no-image.png', + [ + 'class' => 'img-responsive-image1', + ] + ), + [ + 'product/view', + 'id' => $product->id, + ] + ); + ?> +
+ +
+

+ lang->title, + [ + 'product/view', + 'id' => $product->id, + ] + ); + ?> +

+

+ variants[ 0 ]->price_old) { + echo Html::tag('del', $product->variants[ 0 ]->price_old); + } + echo $product->variants[ 0 ]->price; + ?>

+

+ 'fa fa-shopping-cart', + ] + ) . \Yii::t('app', 'В корзину'), + '#', + [ 'class' => 'btn btn-template-main' ] + ); + ?> +

+
+ + is(1)) { + ?> +
+
+
+
+ is(2)) { + ?> +
+
+
+
+ + + +
+ +
diff --git a/frontend/views/category/view.php b/frontend/views/category/view.php index c61220c..aa3083e 100755 --- a/frontend/views/category/view.php +++ b/frontend/views/category/view.php @@ -5,16 +5,21 @@ use artbox\catalog\models\Product; use artbox\core\components\SeoComponent; use yii\bootstrap\Html; + use yii\data\ActiveDataProvider; use yii\web\View; + use yii\widgets\LinkPager; + use yii\widgets\ListView; /** - * @var View $this - * @var Category $model - * @var SeoComponent $seo - * @var FilterHelper $filterHelper + * @var View $this + * @var Category $model + * @var SeoComponent $seo + * @var FilterHelper $filterHelper + * @var ActiveDataProvider $dataProvider */ $seo = \Yii::$app->get('seo'); $filterHelper = \Yii::$app->get('filter'); + $view = $this; $this->params[ 'breadcrumbs' ][] = $seo->title; ?>
@@ -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 @@ _________________________________________________________ --> _________________________________________________________ -->
- -
- - - -
-
-
- - - -
- -
-

White Blouse Armani

-

- $280 - $143.00 -

-

- В корзину -

-
- - -
-
Скидки
-
-
- - -
-
Новое
-
-
- -
- -
- -
-
-
- - - -
- -
-

Black Blouse Versace

-

$143.00

-

- В корзину -

- -
- -
- -
- -
-
-
- - - -
- -
-

Black Blouse Versace

-

$143.00

-

- В корзину -

- -
- -
- -
- -
-
-
- - - -
- -
-

White Blouse Versace

-

$143.00

-

- В корзину -

- -
- - - -
-
Новое
-
-
- -
- -
- -
-
-
- - - -
- -
-

Fur coat

-

$143.00

-

- В корзину -

- -
- -
- -
- - - -
-
-
- - - -
- -
-

White Blouse Armani

-

- $280 - $143.00 -

-

- В корзину -

-
- - -
-
Скидки
-
-
- - -
-
Новое
-
-
- -
- -
- -
-
-
- - - -
- -
-

Black Blouse Versace

-

$143.00

-

- В корзину -

- -
- -
- -
- -
-
-
- - - -
- -
-

Black Blouse Versace

-

$143.00

-

- В корзину -

- -
- -
- -
- -
-
-
- - - -
- -
-

White Blouse Versace

-

$143.00

-

- В корзину -

- -
- - - -
-
Новое
-
-
- -
- -
- -
-
-
- - - -
- -
-

Fur coat

-

$143.00

-

- В корзину -

- -
- -
- -
- - - -
-
-
- - - -
- -
-

White Blouse Armani

-

- $280 - $143.00 -

-

- В корзину -

-
- - -
-
Скидки
-
-
- - -
-
Новое
-
-
- -
- -
- -
-
-
- - - -
- -
-

Black Blouse Versace

-

$143.00

-

- В корзину -

- -
- -
- -
- -
-
-
- - - -
- -
-

Black Blouse Versace

-

$143.00

-

- В корзину -

- -
- -
- -
- -
-
-
- - - -
- -
-

White Blouse Versace

-

$143.00

-

- В корзину -

- -
- - - -
-
Новое
-
-
- -
- -
- -
-
-
- - - -
- -
-

Fur coat

-

$143.00

-

- В корзину -

- -
- -
- -
- -
- - -
- -
    -
  • « -
  • -
  • 1 -
  • -
  • 2 -
  • -
  • 3 -
  • -
  • 4 -
  • -
  • 5 -
  • -
  • » -
  • -
-
- + + [ + '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