Commit dece113d91affbbad0ced53a110e75c932ac78f5
1 parent
a097b6f9
FilterHelper upgrade
Showing
5 changed files
with
185 additions
and
481 deletions
Show diff stats
frontend/controllers/CategoryController.php
1 | 1 | <?php |
2 | 2 | namespace frontend\controllers; |
3 | - | |
3 | + | |
4 | + use artbox\catalog\helpers\FilterHelper; | |
4 | 5 | use artbox\catalog\models\Category; |
5 | 6 | use artbox\core\components\SeoComponent; |
6 | 7 | use artbox\core\models\Page; |
... | ... | @@ -31,6 +32,7 @@ |
31 | 32 | $model = $this->findModel($id); |
32 | 33 | /** |
33 | 34 | * @var SeoComponent $seo |
35 | + * @var FilterHelper $filterHelper | |
34 | 36 | */ |
35 | 37 | $seo = Yii::$app->get('seo'); |
36 | 38 | $seo->setModel($model->lang); |
... | ... | @@ -39,7 +41,10 @@ |
39 | 41 | $query = $filterHelper->buildQuery(); |
40 | 42 | $dataProvider = new ActiveDataProvider( |
41 | 43 | [ |
42 | - 'query' => $query, | |
44 | + 'query' => $query, | |
45 | + 'pagination' => [ | |
46 | + 'pageSize' => 18, | |
47 | + ], | |
43 | 48 | ] |
44 | 49 | ); |
45 | 50 | |
... | ... | @@ -70,7 +75,7 @@ |
70 | 75 | * @var Page $model |
71 | 76 | */ |
72 | 77 | $model = Category::findWithFilters($id) |
73 | - ->with('lang') | |
78 | + ->with('lang.alias') | |
74 | 79 | ->with('categories.lang') |
75 | 80 | ->with( |
76 | 81 | [ |
... | ... | @@ -83,6 +88,7 @@ |
83 | 88 | ] |
84 | 89 | ) |
85 | 90 | ->one(); |
91 | + $seo->setAlias($model->lang->alias); | |
86 | 92 | if (!empty( $model )) { |
87 | 93 | if ($model->lang->alias_id !== $seo->aliasId) { |
88 | 94 | throw new NotFoundHttpException('Wrong language'); | ... | ... |
1 | +<?php | |
2 | + use artbox\catalog\models\Product; | |
3 | + use noam148\imagemanager\components\ImageManagerGetPath; | |
4 | + use yii\helpers\Html; | |
5 | + use yii\web\View; | |
6 | + | |
7 | + /** | |
8 | + * @var View $this | |
9 | + * @var Product $product | |
10 | + * @var ImageManagerGetPath $imageManager | |
11 | + */ | |
12 | + $imageManager = \Yii::$app->get('imagemanager'); | |
13 | +?> | |
14 | +<div class="col-md-4 col-sm-6"> | |
15 | + <div class="product"> | |
16 | + <div class="image"> | |
17 | + <?php | |
18 | + if (!empty( $product->images )) { | |
19 | + $image = $product->images[ 0 ]->id; | |
20 | + } else { | |
21 | + $image = null; | |
22 | + } | |
23 | + echo Html::a( | |
24 | + Html::img( | |
25 | + $image ? $imageManager->getImagePath($image) : '/img/no-image.png', | |
26 | + [ | |
27 | + 'class' => 'img-responsive-image1', | |
28 | + ] | |
29 | + ), | |
30 | + [ | |
31 | + 'product/view', | |
32 | + 'id' => $product->id, | |
33 | + ] | |
34 | + ); | |
35 | + ?> | |
36 | + </div> | |
37 | + <!-- /.image --> | |
38 | + <div class="text"> | |
39 | + <h3> | |
40 | + <?php | |
41 | + echo Html::a( | |
42 | + $product->lang->title, | |
43 | + [ | |
44 | + 'product/view', | |
45 | + 'id' => $product->id, | |
46 | + ] | |
47 | + ); | |
48 | + ?> | |
49 | + </h3> | |
50 | + <p class="price"> | |
51 | + <?php | |
52 | + if ($product->variants[ 0 ]->price_old) { | |
53 | + echo Html::tag('del', $product->variants[ 0 ]->price_old); | |
54 | + } | |
55 | + echo $product->variants[ 0 ]->price; | |
56 | + ?></p> | |
57 | + <p class="buttons"> | |
58 | + <?php | |
59 | + echo Html::a( | |
60 | + Html::tag( | |
61 | + 'i', | |
62 | + '', | |
63 | + [ | |
64 | + 'class' => 'fa fa-shopping-cart', | |
65 | + ] | |
66 | + ) . \Yii::t('app', 'В корзину'), | |
67 | + '#', | |
68 | + [ 'class' => 'btn btn-template-main' ] | |
69 | + ); | |
70 | + ?> | |
71 | + </p> | |
72 | + </div> | |
73 | + <!-- /.text --> | |
74 | + <?php | |
75 | + if ($product->is(1)) { | |
76 | + ?> | |
77 | + <div class="ribbon new"> | |
78 | + <div class="theribbon"><?php echo \Yii::t('app', 'Новое'); ?></div> | |
79 | + <div class="ribbon-background"></div> | |
80 | + </div> | |
81 | + <?php | |
82 | + } | |
83 | + if ($product->is(2)) { | |
84 | + ?> | |
85 | + <div class="ribbon sale"> | |
86 | + <div class="theribbon"><?php echo \Yii::t('app', 'Акция'); ?></div> | |
87 | + <div class="ribbon-background"></div> | |
88 | + </div> | |
89 | + <?php | |
90 | + } | |
91 | + ?> | |
92 | + | |
93 | + <!-- /.ribbon --> | |
94 | + </div> | |
95 | + <!-- /.product --> | |
96 | +</div> | ... | ... |
frontend/views/category/view.php
... | ... | @@ -5,16 +5,21 @@ |
5 | 5 | use artbox\catalog\models\Product; |
6 | 6 | use artbox\core\components\SeoComponent; |
7 | 7 | use yii\bootstrap\Html; |
8 | + use yii\data\ActiveDataProvider; | |
8 | 9 | use yii\web\View; |
10 | + use yii\widgets\LinkPager; | |
11 | + use yii\widgets\ListView; | |
9 | 12 | |
10 | 13 | /** |
11 | - * @var View $this | |
12 | - * @var Category $model | |
13 | - * @var SeoComponent $seo | |
14 | - * @var FilterHelper $filterHelper | |
14 | + * @var View $this | |
15 | + * @var Category $model | |
16 | + * @var SeoComponent $seo | |
17 | + * @var FilterHelper $filterHelper | |
18 | + * @var ActiveDataProvider $dataProvider | |
15 | 19 | */ |
16 | 20 | $seo = \Yii::$app->get('seo'); |
17 | 21 | $filterHelper = \Yii::$app->get('filter'); |
22 | + $view = $this; | |
18 | 23 | $this->params[ 'breadcrumbs' ][] = $seo->title; |
19 | 24 | ?> |
20 | 25 | <div id="content"> |
... | ... | @@ -113,7 +118,10 @@ _________________________________________________________ --> |
113 | 118 | 'id' => $model->id, |
114 | 119 | 'filter' => $filterHelper->buildLink($brand), |
115 | 120 | ] |
116 | - ) | |
121 | + ), | |
122 | + [ | |
123 | + 'class' => $filterHelper->has($brand->lang->alias->value) ? 'active' : '', | |
124 | + ] | |
117 | 125 | ); |
118 | 126 | } |
119 | 127 | ?> |
... | ... | @@ -144,7 +152,12 @@ _________________________________________________________ --> |
144 | 152 | 'id' => $model->id, |
145 | 153 | 'filter' => $filterHelper->buildLink($option), |
146 | 154 | ] |
147 | - ) | |
155 | + ), | |
156 | + [ | |
157 | + 'class' => $filterHelper->has( | |
158 | + $option->lang->alias->value | |
159 | + ) ? 'active' : '', | |
160 | + ] | |
148 | 161 | ); |
149 | 162 | } |
150 | 163 | ?> |
... | ... | @@ -175,7 +188,12 @@ _________________________________________________________ --> |
175 | 188 | 'id' => $model->id, |
176 | 189 | 'filter' => $filterHelper->buildLink($option), |
177 | 190 | ] |
178 | - ) | |
191 | + ), | |
192 | + [ | |
193 | + 'class' => $filterHelper->has( | |
194 | + $option->lang->alias->value | |
195 | + ) ? 'active' : '', | |
196 | + ] | |
179 | 197 | ); |
180 | 198 | } |
181 | 199 | ?> |
... | ... | @@ -206,7 +224,12 @@ _________________________________________________________ --> |
206 | 224 | 'id' => $model->id, |
207 | 225 | 'filter' => $filterHelper->buildLink($option), |
208 | 226 | ] |
209 | - ) | |
227 | + ), | |
228 | + [ | |
229 | + 'class' => $filterHelper->has( | |
230 | + $option->lang->alias->value | |
231 | + ) ? 'active' : '', | |
232 | + ] | |
210 | 233 | ); |
211 | 234 | } |
212 | 235 | ?> |
... | ... | @@ -237,7 +260,12 @@ _________________________________________________________ --> |
237 | 260 | 'id' => $model->id, |
238 | 261 | 'filter' => $filterHelper->buildLink($option), |
239 | 262 | ] |
240 | - ) | |
263 | + ), | |
264 | + [ | |
265 | + 'class' => $filterHelper->has( | |
266 | + $option->lang->alias->value | |
267 | + ) ? 'active' : '', | |
268 | + ] | |
241 | 269 | ); |
242 | 270 | } |
243 | 271 | ?> |
... | ... | @@ -261,474 +289,43 @@ _________________________________________________________ --> |
261 | 289 | _________________________________________________________ --> |
262 | 290 | |
263 | 291 | <div class="col-sm-9"> |
264 | - | |
265 | - <div class="row products"> | |
266 | - | |
267 | - <div class="col-md-4 col-sm-6"> | |
268 | - <div class="product"> | |
269 | - <div class="image"> | |
270 | - <a href="shop-product.html"> | |
271 | - <img src="/img/product1.jpg" alt="" class="img-responsive image1"> | |
272 | - </a> | |
273 | - </div> | |
274 | - <!-- /.image --> | |
275 | - <div class="text"> | |
276 | - <h3><a href="shop-product.html">Fur coat with very but very very long name</a></h3> | |
277 | - <p class="price">$143.00</p> | |
278 | - <p class="buttons"> | |
279 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
280 | - </p> | |
281 | - </div> | |
282 | - <!-- /.text --> | |
283 | - </div> | |
284 | - <!-- /.product --> | |
285 | - </div> | |
286 | - | |
287 | - <div class="col-md-4 col-sm-6"> | |
288 | - <div class="product"> | |
289 | - <div class="image"> | |
290 | - <a href="shop-product.html"> | |
291 | - <img src="/img/product2.jpg" alt="" class="img-responsive image1"> | |
292 | - </a> | |
293 | - </div> | |
294 | - <!-- /.image --> | |
295 | - <div class="text"> | |
296 | - <h3><a href="shop-product.html">White Blouse Armani</a></h3> | |
297 | - <p class="price"> | |
298 | - <del>$280</del> | |
299 | - $143.00 | |
300 | - </p> | |
301 | - <p class="buttons"> | |
302 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
303 | - </p> | |
304 | - </div> | |
305 | - <!-- /.text --> | |
306 | - | |
307 | - <div class="ribbon sale"> | |
308 | - <div class="theribbon">Скидки</div> | |
309 | - <div class="ribbon-background"></div> | |
310 | - </div> | |
311 | - <!-- /.ribbon --> | |
312 | - | |
313 | - <div class="ribbon new"> | |
314 | - <div class="theribbon">Новое</div> | |
315 | - <div class="ribbon-background"></div> | |
316 | - </div> | |
317 | - <!-- /.ribbon --> | |
318 | - </div> | |
319 | - <!-- /.product --> | |
320 | - </div> | |
321 | - | |
322 | - <div class="col-md-4 col-sm-6"> | |
323 | - <div class="product"> | |
324 | - <div class="image"> | |
325 | - <a href="shop-product.html"> | |
326 | - <img src="/img/product3.jpg" alt="" class="img-responsive image1"> | |
327 | - </a> | |
328 | - </div> | |
329 | - <!-- /.image --> | |
330 | - <div class="text"> | |
331 | - <h3><a href="shop-product.html">Black Blouse Versace</a></h3> | |
332 | - <p class="price">$143.00</p> | |
333 | - <p class="buttons"> | |
334 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
335 | - </p> | |
336 | - | |
337 | - </div> | |
338 | - <!-- /.text --> | |
339 | - </div> | |
340 | - <!-- /.product --> | |
341 | - </div> | |
342 | - | |
343 | - <div class="col-md-4 col-sm-6"> | |
344 | - <div class="product"> | |
345 | - <div class="image"> | |
346 | - <a href="shop-product.html"> | |
347 | - <img src="/img/product3.jpg" alt="" class="img-responsive image1"> | |
348 | - </a> | |
349 | - </div> | |
350 | - <!-- /.image --> | |
351 | - <div class="text"> | |
352 | - <h3><a href="shop-product.html">Black Blouse Versace</a></h3> | |
353 | - <p class="price">$143.00</p> | |
354 | - <p class="buttons"> | |
355 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
356 | - </p> | |
357 | - | |
358 | - </div> | |
359 | - <!-- /.text --> | |
360 | - </div> | |
361 | - <!-- /.product --> | |
362 | - </div> | |
363 | - | |
364 | - <div class="col-md-4 col-sm-6"> | |
365 | - <div class="product"> | |
366 | - <div class="image"> | |
367 | - <a href="shop-product.html"> | |
368 | - <img src="/img/product2.jpg" alt="" class="img-responsive image1"> | |
369 | - </a> | |
370 | - </div> | |
371 | - <!-- /.image --> | |
372 | - <div class="text"> | |
373 | - <h3><a href="shop-product.html">White Blouse Versace</a></h3> | |
374 | - <p class="price">$143.00</p> | |
375 | - <p class="buttons"> | |
376 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
377 | - </p> | |
378 | - | |
379 | - </div> | |
380 | - | |
381 | - <!-- /.text --> | |
382 | - | |
383 | - <div class="ribbon new"> | |
384 | - <div class="theribbon">Новое</div> | |
385 | - <div class="ribbon-background"></div> | |
386 | - </div> | |
387 | - <!-- /.ribbon --> | |
388 | - </div> | |
389 | - <!-- /.product --> | |
390 | - </div> | |
391 | - | |
392 | - <div class="col-md-4 col-sm-6"> | |
393 | - <div class="product"> | |
394 | - <div class="image"> | |
395 | - <a href="shop-product.html"> | |
396 | - <img src="/img/product1.jpg" alt="" class="img-responsive image1"> | |
397 | - </a> | |
398 | - </div> | |
399 | - <!-- /.image --> | |
400 | - <div class="text"> | |
401 | - <h3><a href="shop-product.html">Fur coat</a></h3> | |
402 | - <p class="price">$143.00</p> | |
403 | - <p class="buttons"> | |
404 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
405 | - </p> | |
406 | - | |
407 | - </div> | |
408 | - <!-- /.text --> | |
409 | - </div> | |
410 | - <!-- /.product --> | |
411 | - </div> | |
412 | - | |
413 | - <div class="col-md-4 col-sm-6"> | |
414 | - <div class="product"> | |
415 | - <div class="image"> | |
416 | - <a href="shop-product.html"> | |
417 | - <img src="/img/product1.jpg" alt="" class="img-responsive image1"> | |
418 | - </a> | |
419 | - </div> | |
420 | - <!-- /.image --> | |
421 | - <div class="text"> | |
422 | - <h3><a href="shop-product.html">Fur coat with very but very very long name</a></h3> | |
423 | - <p class="price">$143.00</p> | |
424 | - <p class="buttons"> | |
425 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
426 | - </p> | |
427 | - </div> | |
428 | - <!-- /.text --> | |
429 | - </div> | |
430 | - <!-- /.product --> | |
431 | - </div> | |
432 | - | |
433 | - <div class="col-md-4 col-sm-6"> | |
434 | - <div class="product"> | |
435 | - <div class="image"> | |
436 | - <a href="shop-product.html"> | |
437 | - <img src="/img/product2.jpg" alt="" class="img-responsive image1"> | |
438 | - </a> | |
439 | - </div> | |
440 | - <!-- /.image --> | |
441 | - <div class="text"> | |
442 | - <h3><a href="shop-product.html">White Blouse Armani</a></h3> | |
443 | - <p class="price"> | |
444 | - <del>$280</del> | |
445 | - $143.00 | |
446 | - </p> | |
447 | - <p class="buttons"> | |
448 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
449 | - </p> | |
450 | - </div> | |
451 | - <!-- /.text --> | |
452 | - | |
453 | - <div class="ribbon sale"> | |
454 | - <div class="theribbon">Скидки</div> | |
455 | - <div class="ribbon-background"></div> | |
456 | - </div> | |
457 | - <!-- /.ribbon --> | |
458 | - | |
459 | - <div class="ribbon new"> | |
460 | - <div class="theribbon">Новое</div> | |
461 | - <div class="ribbon-background"></div> | |
462 | - </div> | |
463 | - <!-- /.ribbon --> | |
464 | - </div> | |
465 | - <!-- /.product --> | |
466 | - </div> | |
467 | - | |
468 | - <div class="col-md-4 col-sm-6"> | |
469 | - <div class="product"> | |
470 | - <div class="image"> | |
471 | - <a href="shop-product.html"> | |
472 | - <img src="/img/product3.jpg" alt="" class="img-responsive image1"> | |
473 | - </a> | |
474 | - </div> | |
475 | - <!-- /.image --> | |
476 | - <div class="text"> | |
477 | - <h3><a href="shop-product.html">Black Blouse Versace</a></h3> | |
478 | - <p class="price">$143.00</p> | |
479 | - <p class="buttons"> | |
480 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
481 | - </p> | |
482 | - | |
483 | - </div> | |
484 | - <!-- /.text --> | |
485 | - </div> | |
486 | - <!-- /.product --> | |
487 | - </div> | |
488 | - | |
489 | - <div class="col-md-4 col-sm-6"> | |
490 | - <div class="product"> | |
491 | - <div class="image"> | |
492 | - <a href="shop-product.html"> | |
493 | - <img src="/img/product3.jpg" alt="" class="img-responsive image1"> | |
494 | - </a> | |
495 | - </div> | |
496 | - <!-- /.image --> | |
497 | - <div class="text"> | |
498 | - <h3><a href="shop-product.html">Black Blouse Versace</a></h3> | |
499 | - <p class="price">$143.00</p> | |
500 | - <p class="buttons"> | |
501 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
502 | - </p> | |
503 | - | |
504 | - </div> | |
505 | - <!-- /.text --> | |
506 | - </div> | |
507 | - <!-- /.product --> | |
508 | - </div> | |
509 | - | |
510 | - <div class="col-md-4 col-sm-6"> | |
511 | - <div class="product"> | |
512 | - <div class="image"> | |
513 | - <a href="shop-product.html"> | |
514 | - <img src="/img/product2.jpg" alt="" class="img-responsive image1"> | |
515 | - </a> | |
516 | - </div> | |
517 | - <!-- /.image --> | |
518 | - <div class="text"> | |
519 | - <h3><a href="shop-product.html">White Blouse Versace</a></h3> | |
520 | - <p class="price">$143.00</p> | |
521 | - <p class="buttons"> | |
522 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
523 | - </p> | |
524 | - | |
525 | - </div> | |
526 | - | |
527 | - <!-- /.text --> | |
528 | - | |
529 | - <div class="ribbon new"> | |
530 | - <div class="theribbon">Новое</div> | |
531 | - <div class="ribbon-background"></div> | |
532 | - </div> | |
533 | - <!-- /.ribbon --> | |
534 | - </div> | |
535 | - <!-- /.product --> | |
536 | - </div> | |
537 | - | |
538 | - <div class="col-md-4 col-sm-6"> | |
539 | - <div class="product"> | |
540 | - <div class="image"> | |
541 | - <a href="shop-product.html"> | |
542 | - <img src="/img/product1.jpg" alt="" class="img-responsive image1"> | |
543 | - </a> | |
544 | - </div> | |
545 | - <!-- /.image --> | |
546 | - <div class="text"> | |
547 | - <h3><a href="shop-product.html">Fur coat</a></h3> | |
548 | - <p class="price">$143.00</p> | |
549 | - <p class="buttons"> | |
550 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
551 | - </p> | |
552 | - | |
553 | - </div> | |
554 | - <!-- /.text --> | |
555 | - </div> | |
556 | - <!-- /.product --> | |
557 | - </div> | |
558 | - | |
559 | - <div class="col-md-4 col-sm-6"> | |
560 | - <div class="product"> | |
561 | - <div class="image"> | |
562 | - <a href="shop-product.html"> | |
563 | - <img src="/img/product1.jpg" alt="" class="img-responsive image1"> | |
564 | - </a> | |
565 | - </div> | |
566 | - <!-- /.image --> | |
567 | - <div class="text"> | |
568 | - <h3><a href="shop-product.html">Fur coat with very but very very long name</a></h3> | |
569 | - <p class="price">$143.00</p> | |
570 | - <p class="buttons"> | |
571 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
572 | - </p> | |
573 | - </div> | |
574 | - <!-- /.text --> | |
575 | - </div> | |
576 | - <!-- /.product --> | |
577 | - </div> | |
578 | - | |
579 | - <div class="col-md-4 col-sm-6"> | |
580 | - <div class="product"> | |
581 | - <div class="image"> | |
582 | - <a href="shop-product.html"> | |
583 | - <img src="/img/product2.jpg" alt="" class="img-responsive image1"> | |
584 | - </a> | |
585 | - </div> | |
586 | - <!-- /.image --> | |
587 | - <div class="text"> | |
588 | - <h3><a href="shop-product.html">White Blouse Armani</a></h3> | |
589 | - <p class="price"> | |
590 | - <del>$280</del> | |
591 | - $143.00 | |
592 | - </p> | |
593 | - <p class="buttons"> | |
594 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
595 | - </p> | |
596 | - </div> | |
597 | - <!-- /.text --> | |
598 | - | |
599 | - <div class="ribbon sale"> | |
600 | - <div class="theribbon">Скидки</div> | |
601 | - <div class="ribbon-background"></div> | |
602 | - </div> | |
603 | - <!-- /.ribbon --> | |
604 | - | |
605 | - <div class="ribbon new"> | |
606 | - <div class="theribbon">Новое</div> | |
607 | - <div class="ribbon-background"></div> | |
608 | - </div> | |
609 | - <!-- /.ribbon --> | |
610 | - </div> | |
611 | - <!-- /.product --> | |
612 | - </div> | |
613 | - | |
614 | - <div class="col-md-4 col-sm-6"> | |
615 | - <div class="product"> | |
616 | - <div class="image"> | |
617 | - <a href="shop-product.html"> | |
618 | - <img src="/img/product3.jpg" alt="" class="img-responsive image1"> | |
619 | - </a> | |
620 | - </div> | |
621 | - <!-- /.image --> | |
622 | - <div class="text"> | |
623 | - <h3><a href="shop-product.html">Black Blouse Versace</a></h3> | |
624 | - <p class="price">$143.00</p> | |
625 | - <p class="buttons"> | |
626 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
627 | - </p> | |
628 | - | |
629 | - </div> | |
630 | - <!-- /.text --> | |
631 | - </div> | |
632 | - <!-- /.product --> | |
633 | - </div> | |
634 | - | |
635 | - <div class="col-md-4 col-sm-6"> | |
636 | - <div class="product"> | |
637 | - <div class="image"> | |
638 | - <a href="shop-product.html"> | |
639 | - <img src="/img/product3.jpg" alt="" class="img-responsive image1"> | |
640 | - </a> | |
641 | - </div> | |
642 | - <!-- /.image --> | |
643 | - <div class="text"> | |
644 | - <h3><a href="shop-product.html">Black Blouse Versace</a></h3> | |
645 | - <p class="price">$143.00</p> | |
646 | - <p class="buttons"> | |
647 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
648 | - </p> | |
649 | - | |
650 | - </div> | |
651 | - <!-- /.text --> | |
652 | - </div> | |
653 | - <!-- /.product --> | |
654 | - </div> | |
655 | - | |
656 | - <div class="col-md-4 col-sm-6"> | |
657 | - <div class="product"> | |
658 | - <div class="image"> | |
659 | - <a href="shop-product.html"> | |
660 | - <img src="/img/product2.jpg" alt="" class="img-responsive image1"> | |
661 | - </a> | |
662 | - </div> | |
663 | - <!-- /.image --> | |
664 | - <div class="text"> | |
665 | - <h3><a href="shop-product.html">White Blouse Versace</a></h3> | |
666 | - <p class="price">$143.00</p> | |
667 | - <p class="buttons"> | |
668 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
669 | - </p> | |
670 | - | |
671 | - </div> | |
672 | - | |
673 | - <!-- /.text --> | |
674 | - | |
675 | - <div class="ribbon new"> | |
676 | - <div class="theribbon">Новое</div> | |
677 | - <div class="ribbon-background"></div> | |
678 | - </div> | |
679 | - <!-- /.ribbon --> | |
680 | - </div> | |
681 | - <!-- /.product --> | |
682 | - </div> | |
683 | - | |
684 | - <div class="col-md-4 col-sm-6"> | |
685 | - <div class="product"> | |
686 | - <div class="image"> | |
687 | - <a href="shop-product.html"> | |
688 | - <img src="/img/product1.jpg" alt="" class="img-responsive image1"> | |
689 | - </a> | |
690 | - </div> | |
691 | - <!-- /.image --> | |
692 | - <div class="text"> | |
693 | - <h3><a href="shop-product.html">Fur coat</a></h3> | |
694 | - <p class="price">$143.00</p> | |
695 | - <p class="buttons"> | |
696 | - <a href="shop-basket.html" class="btn btn-template-main"><i class="fa fa-shopping-cart"></i>В корзину</a> | |
697 | - </p> | |
698 | - | |
699 | - </div> | |
700 | - <!-- /.text --> | |
701 | - </div> | |
702 | - <!-- /.product --> | |
703 | - </div> | |
704 | - <!-- /.col-md-4 --> | |
705 | - </div> | |
706 | - <!-- /.products --> | |
707 | - | |
708 | - <div class="pages"> | |
709 | - <!-- | |
710 | - <p class="loadMore"> | |
711 | - <a href="#" class="btn btn-template-main"><i class="fa fa-chevron-down"></i> Load more</a> | |
712 | - </p> | |
713 | - --> | |
714 | - <ul class="pagination"> | |
715 | - <li><a href="#">«</a> | |
716 | - </li> | |
717 | - <li class="active"><a href="#">1</a> | |
718 | - </li> | |
719 | - <li><a href="#">2</a> | |
720 | - </li> | |
721 | - <li><a href="#">3</a> | |
722 | - </li> | |
723 | - <li><a href="#">4</a> | |
724 | - </li> | |
725 | - <li><a href="#">5</a> | |
726 | - </li> | |
727 | - <li><a href="#">»</a> | |
728 | - </li> | |
729 | - </ul> | |
730 | - </div> | |
731 | - | |
292 | + | |
293 | + <?php | |
294 | + echo ListView::widget( | |
295 | + [ | |
296 | + 'options' => [ | |
297 | + 'class' => 'row products', | |
298 | + ], | |
299 | + 'itemOptions' => [ | |
300 | + 'tag' => false, | |
301 | + ], | |
302 | + 'layout' => '{items}', | |
303 | + 'dataProvider' => $dataProvider, | |
304 | + 'itemView' => function ($model) use ($view) { | |
305 | + /** | |
306 | + * @var Product $model | |
307 | + */ | |
308 | + return $view->render( | |
309 | + '_product_item', | |
310 | + [ | |
311 | + 'product' => $model, | |
312 | + ] | |
313 | + ); | |
314 | + }, | |
315 | + ] | |
316 | + ); | |
317 | + echo Html::tag( | |
318 | + 'div', | |
319 | + LinkPager::widget( | |
320 | + [ | |
321 | + 'pagination' => $dataProvider->pagination, | |
322 | + ] | |
323 | + ), | |
324 | + [ | |
325 | + 'class' => 'pages', | |
326 | + ] | |
327 | + ); | |
328 | + ?> | |
732 | 329 | |
733 | 330 | </div> |
734 | 331 | <!-- /.col-md-9 --> | ... | ... |
frontend/views/site/_slider_product.php
frontend/web/css/style.css
... | ... | @@ -2806,6 +2806,10 @@ p.no-margin { |
2806 | 2806 | .products { |
2807 | 2807 | content: " "; |
2808 | 2808 | display: table; |
2809 | + | |
2810 | +} | |
2811 | + | |
2812 | +.row.products { | |
2809 | 2813 | width: 100%; |
2810 | 2814 | } |
2811 | 2815 | |
... | ... | @@ -2827,6 +2831,7 @@ p.no-margin { |
2827 | 2831 | -webkit-transition: all 0.2s ease-out; |
2828 | 2832 | -moz-transition: all 0.2s ease-out; |
2829 | 2833 | transition: all 0.2s ease-out; |
2834 | + max-width: 100%; | |
2830 | 2835 | } |
2831 | 2836 | |
2832 | 2837 | .product-video { | ... | ... |