Commit a2ea902f772ba40933b1b0555ea90d856d9f9a13
1 parent
e4f8f25d
image size
Showing
4 changed files
with
25 additions
and
7 deletions
Show diff stats
common/modules/product/widgets/views/product_smart.php
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | /** @var \common\modules\product\models\Product $product */ | 2 | /** @var \common\modules\product\models\Product $product */ |
3 | use yii\helpers\Url; | 3 | use yii\helpers\Url; |
4 | ?> | 4 | ?> |
5 | -<li class="item"> | 5 | +<div class="item"> |
6 | <div class="boxitem"> | 6 | <div class="boxitem"> |
7 | <div class="pixbox"> | 7 | <div class="pixbox"> |
8 | <a href="<?= Url::to([ | 8 | <a href="<?= Url::to([ |
@@ -53,4 +53,4 @@ use yii\helpers\Url; | @@ -53,4 +53,4 @@ use yii\helpers\Url; | ||
53 | <?php endforeach; ?> | 53 | <?php endforeach; ?> |
54 | </ul> | 54 | </ul> |
55 | </div> | 55 | </div> |
56 | -</li> | ||
57 | \ No newline at end of file | 56 | \ No newline at end of file |
57 | +</div> | ||
58 | \ No newline at end of file | 58 | \ No newline at end of file |
common/modules/product/widgets/views/products_block.php
1 | +<?php | ||
2 | + use yii\web\View; | ||
3 | +?> | ||
1 | <div class="_prd_spec-wr"> | 4 | <div class="_prd_spec-wr"> |
2 | - <div class="special-products products<?= (!empty($class) ? ' '. $class : '')?>"> | 5 | + <div class="special-products products<?= |
6 | + | ||
7 | + (!empty($class) ? ' '. $class : '')?>"> | ||
3 | <h3><?= $title?></h3> | 8 | <h3><?= $title?></h3> |
4 | - <ul> | 9 | + <div class="owl-carousel"> |
5 | <?php foreach($products as $product) :?> | 10 | <?php foreach($products as $product) :?> |
6 | <?= $this->render('product_smart', ['product' => $product]);?> | 11 | <?= $this->render('product_smart', ['product' => $product]);?> |
7 | <?php endforeach?> | 12 | <?php endforeach?> |
8 | - </ul> | 13 | + </div> |
9 | <div class="both"></div> | 14 | <div class="both"></div> |
10 | </div> | 15 | </div> |
11 | -</div> | ||
12 | \ No newline at end of file | 16 | \ No newline at end of file |
17 | +</div> | ||
18 | + | ||
19 | +<?php $js = '$(".owl-carousel").owlCarousel({ | ||
20 | + // Navigation | ||
21 | + navigation : true, | ||
22 | + navigationText : ["prev","next"], | ||
23 | + rewindNav : true, | ||
24 | + scrollPerPage : false, | ||
25 | + pagination : false | ||
26 | + })'; | ||
27 | +$this->registerJs($js, View::POS_READY); | ||
28 | +?> | ||
13 | \ No newline at end of file | 29 | \ No newline at end of file |
composer.json
@@ -41,7 +41,8 @@ | @@ -41,7 +41,8 @@ | ||
41 | "kartik-v/yii2-widget-fileinput": "@dev", | 41 | "kartik-v/yii2-widget-fileinput": "@dev", |
42 | "maxmirazh33/yii2-uploadable-cropable-image": "*", | 42 | "maxmirazh33/yii2-uploadable-cropable-image": "*", |
43 | "iutbay/yii2-imagecache": "*", | 43 | "iutbay/yii2-imagecache": "*", |
44 | - "yurkinx/yii2-image": "dev-master" | 44 | + "yurkinx/yii2-image": "dev-master", |
45 | + "sersid/yii2-owl-carousel-asset": "*" | ||
45 | }, | 46 | }, |
46 | "require-dev": { | 47 | "require-dev": { |
47 | "yiisoft/yii2-codeception": "*", | 48 | "yiisoft/yii2-codeception": "*", |
frontend/assets/AppAsset.php
@@ -25,6 +25,7 @@ class AppAsset extends AssetBundle | @@ -25,6 +25,7 @@ class AppAsset extends AssetBundle | ||
25 | ]; | 25 | ]; |
26 | public $depends = [ | 26 | public $depends = [ |
27 | 'yii\web\JqueryAsset', | 27 | 'yii\web\JqueryAsset', |
28 | + 'sersid\owlcarousel\Asset' | ||
28 | //'yii\web\YiiAsset', | 29 | //'yii\web\YiiAsset', |
29 | //'yii\bootstrap\BootstrapAsset', | 30 | //'yii\bootstrap\BootstrapAsset', |
30 | ]; | 31 | ]; |