Commit dc2cd0174e6eeb554bf77b9fe0b4dfd3f23dc064

Authored by Karnovsky A
1 parent 1772b984

-

backend/views/slider-image/_form.php
@@ -23,7 +23,7 @@ use yii\widgets\ActiveForm; @@ -23,7 +23,7 @@ use yii\widgets\ActiveForm;
23 ], 23 ],
24 'pluginOptions' => [ 24 'pluginOptions' => [
25 'allowedFileExtensions' => ['jpg','gif','png'], 25 'allowedFileExtensions' => ['jpg','gif','png'],
26 - 'initialPreview' => $model->imageUrl ? Yii::$app->imageCache->thumb($model->imageUrl, 'slider') : '', 26 + 'initialPreview' => $model->imageUrl ? \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'slider') : '',
27 'overwriteInitial' => true, 27 'overwriteInitial' => true,
28 'showRemove' => true, 28 'showRemove' => true,
29 'showUpload' => false, 29 'showUpload' => false,
backend/web/css/site.css
  1 +@import url("//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css");
  2 +
1 html, 3 html,
2 body { 4 body {
3 height: 100%; 5 height: 100%;
common/config/main.php
@@ -75,49 +75,46 @@ return [ @@ -75,49 +75,46 @@ return [
75 'height' => 300, 75 'height' => 300,
76 'master' => null 76 'master' => null
77 ], 77 ],
78 - /*'flip' => [  
79 - 'direction' => \common\components\artboximage\drivers\Image::HORIZONTAL  
80 - ]*/  
81 ], 78 ],
82 - 'brandlist' => [ 79 + 'product_variant' => [
83 'resize' => [ 80 'resize' => [
84 - 'width' => 138,  
85 - 'height' => 78, 81 + 'width' => 44,
  82 + 'height' => 44,
86 'master' => null 83 'master' => null
87 ], 84 ],
88 ], 85 ],
89 - 'product_trumb' => [ 86 + 'product_trumb2' => [
90 'resize' => [ 87 'resize' => [
91 - 'width' => 80,  
92 - 'height' => 80, 88 + 'width' => 100,
  89 + 'height' => 100,
93 'master' => null 90 'master' => null
94 ], 91 ],
95 ], 92 ],
96 - 'product_variant' => [ 93 + 'slider' => [
97 'resize' => [ 94 'resize' => [
98 - 'width' => 44,  
99 - 'height' => 44, 95 + 'width' => 720,
  96 + 'height' => 340,
100 'master' => null 97 'master' => null
101 ], 98 ],
102 ], 99 ],
103 - 'product_list' => [ 100 + 'brandlist' => [
104 'resize' => [ 101 'resize' => [
105 - 'width' => 130,  
106 - 'height' => 70, 102 + 'width' => 128,
  103 + 'height' => 128,
107 'master' => null 104 'master' => null
108 ], 105 ],
109 ], 106 ],
110 - 'product_list2' => [ 107 + 'mainmenu' => [
111 'resize' => [ 108 'resize' => [
112 - 'width' => 130,  
113 - 'height' => 70, 109 + 'width' => 160,
  110 + 'height' => 170,
114 'master' => null 111 'master' => null
115 ], 112 ],
116 ], 113 ],
117 - 'mainmenu' => [ 114 + 'list' => [
118 'resize' => [ 115 'resize' => [
119 - 'width' => 160,  
120 - 'height' => 170, 116 + 'width' => 134,
  117 + 'height' => 200,
121 'master' => null 118 'master' => null
122 ], 119 ],
123 ], 120 ],
common/models/Share.php 0 → 100644
  1 +<?php
  2 +
  3 +namespace common\models;
  4 +
  5 +use Yii;
  6 +
  7 +class Share extends \yii\db\ActiveRecord
  8 +{
  9 +
  10 + public static function tableName()
  11 + {
  12 + return 'share';
  13 + }
  14 +
  15 + public function attributeLabels()
  16 + {
  17 + return [
  18 + 'product_name' => 'Название',
  19 + 'date_time'=>'Дата',
  20 + ];
  21 + }
  22 +
  23 + public function beforeSave($insert) {
  24 + $this->user_id = Yii::$app->user->id;
  25 + $this->date_time = time();
  26 + $this->date = new \yii\db\Expression('NOW()');
  27 + return parent::beforeSave($insert);
  28 + }
  29 +
  30 + public function beforeDelete() {
  31 + return parent::beforeDelete();
  32 + }
  33 +
  34 + public function getProduct()
  35 + {
  36 + return $this->hasOne(Products::className(), ['id' => 'product_id']);
  37 + }
  38 +
  39 + public function getShareList()
  40 + {
  41 + return $this->hasMany(self::className(), ['date' => 'date'])->where(['user_id'=>Yii::$app->user->id])->orderBy('id DESC');
  42 + }
  43 +
  44 +}
common/modules/product/controllers/ManageController.php
@@ -127,7 +127,7 @@ class ManageController extends Controller @@ -127,7 +127,7 @@ class ManageController extends Controller
127 if ($model->load(Yii::$app->request->post())) { 127 if ($model->load(Yii::$app->request->post())) {
128 $model->imagesUpload = UploadedFile::getInstances($model, 'imagesUpload'); 128 $model->imagesUpload = UploadedFile::getInstances($model, 'imagesUpload');
129 129
130 - if ($model->save()) { 130 + if ($model->save() && $model->imagesUpload) {
131 foreach ($model->images as $image) { 131 foreach ($model->images as $image) {
132 $image->delete(); 132 $image->delete();
133 } 133 }
@@ -214,6 +214,36 @@ class ManageController extends Controller @@ -214,6 +214,36 @@ class ManageController extends Controller
214 exit; 214 exit;
215 } 215 }
216 216
  217 + public function actionIs_top($id) {
  218 + $model = $this->findModel($id);
  219 +
  220 + $model->is_top = intval(empty($model->is_top));
  221 +
  222 + $model->save(false, ['is_top']);
  223 +
  224 + return $this->redirect(['index']);
  225 + }
  226 +
  227 + public function actionIs_new($id) {
  228 + $model = $this->findModel($id);
  229 +
  230 + $model->is_new = intval(empty($model->is_new));
  231 +
  232 + $model->save(false, ['is_new']);
  233 +
  234 + return $this->redirect(['index']);
  235 + }
  236 +
  237 + public function actionAkciya($id) {
  238 + $model = $this->findModel($id);
  239 +
  240 + $model->akciya = intval(empty($model->akciya));
  241 +
  242 + $model->save(false, ['akciya']);
  243 +
  244 + return $this->redirect(['index']);
  245 + }
  246 +
217 public function actionImport() { 247 public function actionImport() {
218 $searchModel = new RemoteProductsSearch(); 248 $searchModel = new RemoteProductsSearch();
219 $dataProvider = $searchModel->search(Yii::$app->request->queryParams); 249 $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
common/modules/product/helpers/ProductHelper.php
@@ -69,8 +69,23 @@ class ProductHelper extends Object { @@ -69,8 +69,23 @@ class ProductHelper extends Object {
69 public static function getLastProducts($as_object = false) { 69 public static function getLastProducts($as_object = false) {
70 $last_products = Yii::$app->session->get('last_products', []); 70 $last_products = Yii::$app->session->get('last_products', []);
71 if ($as_object) { 71 if ($as_object) {
72 - $last_products = Product::find()->where(['product_id' => $last_products])->all(); 72 + $last_products = array_reverse(Product::find()->where(['product_id' => $last_products])->all());
73 } 73 }
74 return $last_products; 74 return $last_products;
75 } 75 }
  76 +
  77 + public static function getSpecialProducts($type, $count, $sort = null) {
  78 + switch($type) {
  79 + case 'top':
  80 + $data = ['is_top' => true];
  81 + break;
  82 + case 'new':
  83 + $data = ['is_new' => true];
  84 + break;
  85 + case 'promo':
  86 + $data = ['akciya' => true];
  87 + break;
  88 + }
  89 + return Product::find()->where($data)->limit($count)/*->orderBy($sort)*/->all();
  90 + }
76 } 91 }
77 \ No newline at end of file 92 \ No newline at end of file
common/modules/product/models/Product.php
@@ -24,6 +24,7 @@ use yii\web\UploadedFile; @@ -24,6 +24,7 @@ use yii\web\UploadedFile;
24 * @property array $images 24 * @property array $images
25 * @property boolean $is_top 25 * @property boolean $is_top
26 * @property boolean $is_new 26 * @property boolean $is_new
  27 + * @property boolean $akciya
27 */ 28 */
28 class Product extends \yii\db\ActiveRecord 29 class Product extends \yii\db\ActiveRecord
29 { 30 {
@@ -72,9 +73,9 @@ class Product extends \yii\db\ActiveRecord @@ -72,9 +73,9 @@ class Product extends \yii\db\ActiveRecord
72 [['name'], 'string', 'max' => 150], 73 [['name'], 'string', 'max' => 150],
73 [['alias'], 'string', 'max' => 250], 74 [['alias'], 'string', 'max' => 250],
74 [['categories', 'variants', 'options', 'imagesUpload'], 'safe'], 75 [['categories', 'variants', 'options', 'imagesUpload'], 'safe'],
75 - [['imagesUpload'], 'file', 'skipOnEmpty' => false, 'extensions' => 'png, jpg, gif', 'maxFiles' => 50], 76 +// [['imagesUpload'], 'file', 'skipOnEmpty' => false, 'extensions' => 'png, jpg, gif', 'maxFiles' => 50],
76 [['description', 'video'], 'safe'], 77 [['description', 'video'], 'safe'],
77 - [['is_top', 'is_new'], 'boolean'], 78 + [['is_top', 'is_new', 'akciya'], 'boolean'],
78 // [['product_id'], 'exist', 'skipOnError' => true, 'targetClass' => Product::className(), 'targetAttribute' => ['product_id' => 'product_id']], 79 // [['product_id'], 'exist', 'skipOnError' => true, 'targetClass' => Product::className(), 'targetAttribute' => ['product_id' => 'product_id']],
79 ]; 80 ];
80 } 81 }
@@ -97,6 +98,7 @@ class Product extends \yii\db\ActiveRecord @@ -97,6 +98,7 @@ class Product extends \yii\db\ActiveRecord
97 'variants' => Yii::t('product', 'Variants'), 98 'variants' => Yii::t('product', 'Variants'),
98 'is_top' => Yii::t('product', 'Is top'), 99 'is_top' => Yii::t('product', 'Is top'),
99 'is_new' => Yii::t('product', 'Is new'), 100 'is_new' => Yii::t('product', 'Is new'),
  101 + 'akciya' => Yii::t('product', 'Is promo'),
100 ]; 102 ];
101 } 103 }
102 104
@@ -117,6 +119,16 @@ class Product extends \yii\db\ActiveRecord @@ -117,6 +119,16 @@ class Product extends \yii\db\ActiveRecord
117 } 119 }
118 120
119 /** 121 /**
  122 + * fetch stored image url
  123 + * @return string
  124 + */
  125 + public function getImageUrl()
  126 + {
  127 + // return a default image placeholder if your source image is not found
  128 + return !empty($this->image) ? $this->image->imageUrl : '/images/no_photo.png';
  129 + }
  130 +
  131 + /**
120 * @return \yii\db\ActiveQuery 132 * @return \yii\db\ActiveQuery
121 */ 133 */
122 public function getImages() 134 public function getImages()
@@ -200,7 +212,7 @@ class Product extends \yii\db\ActiveRecord @@ -200,7 +212,7 @@ class Product extends \yii\db\ActiveRecord
200 // 212 //
201 // } 213 // }
202 214
203 - $todel = []; 215 + /*$todel = [];
204 foreach ($this->variants ? : [] as $_variant) { 216 foreach ($this->variants ? : [] as $_variant) {
205 $todel[$_variant->product_variant_id] = $_variant->product_variant_id; 217 $todel[$_variant->product_variant_id] = $_variant->product_variant_id;
206 } 218 }
@@ -220,7 +232,7 @@ class Product extends \yii\db\ActiveRecord @@ -220,7 +232,7 @@ class Product extends \yii\db\ActiveRecord
220 } 232 }
221 if (!empty($todel)) { 233 if (!empty($todel)) {
222 ProductVariant::deleteAll(['product_variant_id' => $todel]); 234 ProductVariant::deleteAll(['product_variant_id' => $todel]);
223 - } 235 + }*/
224 } 236 }
225 237
226 public function imagesUpload() 238 public function imagesUpload()
common/modules/product/models/ProductImage.php
@@ -107,7 +107,7 @@ class ProductImage extends \yii\db\ActiveRecord @@ -107,7 +107,7 @@ class ProductImage extends \yii\db\ActiveRecord
107 public function getImageUrl() 107 public function getImageUrl()
108 { 108 {
109 // return a default image placeholder if your source image is not found 109 // return a default image placeholder if your source image is not found
110 - return isset($this->image) ? '/images/products/'. $this->image : 'default.jpg'; 110 + return isset($this->image) ? '/images/products/'. $this->image : '/images/no_photo.png';
111 } 111 }
112 112
113 /** 113 /**
common/modules/product/models/ProductSearch.php
@@ -72,18 +72,32 @@ class ProductSearch extends Product @@ -72,18 +72,32 @@ class ProductSearch extends Product
72 72
73 $query->joinWith(['brand', 'brand.brandNames', 'categories', 'categories.categoryNames']); 73 $query->joinWith(['brand', 'brand.brandNames', 'categories', 'categories.categoryNames']);
74 74
75 - // grid filtering conditions 75 + if (isset($this->is_top)) {
  76 + $query->andFilterWhere([
  77 + 'is_top' => (bool)$this->is_top,
  78 + ]);
  79 + }
  80 + if (isset($this->is_new)) {
  81 + $query->andFilterWhere([
  82 + 'is_new' => (bool)$this->is_new,
  83 + ]);
  84 + }
  85 + if (isset($this->akciya)) {
  86 + $query->andFilterWhere([
  87 + 'akciya' => (bool)$this->akciya,
  88 + ]);
  89 + }
76 $query->andFilterWhere([ 90 $query->andFilterWhere([
77 'tax_brand_id' => $this->tax_brand_id, 91 'tax_brand_id' => $this->tax_brand_id,
78 'product_id' => $this->product_id, 92 'product_id' => $this->product_id,
79 - 'is_top' => (bool)$this->is_top,  
80 - 'is_new' => (bool)$this->is_new,  
81 ]); 93 ]);
82 94
83 $query->andFilterWhere(['ilike', 'name', $this->name]); 95 $query->andFilterWhere(['ilike', 'name', $this->name]);
84 $query->andFilterWhere(['ilike', 'brand_name.value', $this->brand_name]); 96 $query->andFilterWhere(['ilike', 'brand_name.value', $this->brand_name]);
85 $query->andFilterWhere(['ilike', 'category_name.value', $this->category_name]); 97 $query->andFilterWhere(['ilike', 'category_name.value', $this->category_name]);
86 98
  99 + $query->orderBy('product.product_id', 'DESC');
  100 +
87 return $dataProvider; 101 return $dataProvider;
88 } 102 }
89 103
common/modules/product/models/ProductVariant.php
@@ -123,6 +123,16 @@ class ProductVariant extends \yii\db\ActiveRecord @@ -123,6 +123,16 @@ class ProductVariant extends \yii\db\ActiveRecord
123 } 123 }
124 124
125 /** 125 /**
  126 + * fetch stored image url
  127 + * @return string
  128 + */
  129 + public function getImageUrl()
  130 + {
  131 + // return a default image placeholder if your source image is not found
  132 + return !empty($this->image) ? $this->image->imageUrl : '/images/no_photo.png';
  133 + }
  134 +
  135 + /**
126 * @return \yii\db\ActiveQuery 136 * @return \yii\db\ActiveQuery
127 */ 137 */
128 public function getImages() 138 public function getImages()
common/modules/product/views/manage/_form.php
@@ -23,6 +23,9 @@ use kartik\select2\Select2; @@ -23,6 +23,9 @@ use kartik\select2\Select2;
23 23
24 <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?> 24 <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
25 25
  26 + <?= $form->field($model, 'is_top')->checkbox() ?>
  27 + <?= $form->field($model, 'is_new')->checkbox() ?>
  28 +
26 <?= $form->field($model, 'description')->widget(\mihaildev\ckeditor\CKEditor::className(),['editorOptions' => [ 'preset' => 'full', 'inline' => false, ], ]); ?> 29 <?= $form->field($model, 'description')->widget(\mihaildev\ckeditor\CKEditor::className(),['editorOptions' => [ 'preset' => 'full', 'inline' => false, ], ]); ?>
27 <?= $form->field($model, 'video')->textarea(); ?> 30 <?= $form->field($model, 'video')->textarea(); ?>
28 31
common/modules/product/views/manage/index.php
@@ -40,7 +40,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title; @@ -40,7 +40,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
40 40
41 [ 41 [
42 'class' => 'yii\grid\ActionColumn', 42 'class' => 'yii\grid\ActionColumn',
43 - 'template' => '{view} {is_top} {is_new} {update} {delete}', 43 + 'template' => '{view} |{is_top} {is_new} {akciya} | {update} {delete}',
44 'buttons' => [ 44 'buttons' => [
45 'is_top' => function ($url, $model) { 45 'is_top' => function ($url, $model) {
46 return Html::a('<span class="glyphicon glyphicon-star' . ($model->is_top ? '' : '-empty') . '"></span>', $url, [ 46 return Html::a('<span class="glyphicon glyphicon-star' . ($model->is_top ? '' : '-empty') . '"></span>', $url, [
@@ -52,6 +52,11 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title; @@ -52,6 +52,11 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
52 'title' => Yii::t('product', ($model->is_new ? 'Set not is new' : 'Set is new')), 52 'title' => Yii::t('product', ($model->is_new ? 'Set not is new' : 'Set is new')),
53 ]); 53 ]);
54 }, 54 },
  55 + 'akciya' => function ($url, $model) {
  56 + return Html::a('<span class="glyphicon glyphicon-tag' . ($model->akciya ? 's' : '') . '"></span>', $url, [
  57 + 'title' => Yii::t('product', ($model->akciya ? 'Set not is promotion' : 'Set is promotion')),
  58 + ]);
  59 + },
55 ], 60 ],
56 'urlCreator' => function ($action, $model, $key, $index) { 61 'urlCreator' => function ($action, $model, $key, $index) {
57 switch ($action) { 62 switch ($action) {
@@ -61,6 +66,9 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title; @@ -61,6 +66,9 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
61 case 'is_new': 66 case 'is_new':
62 return \yii\helpers\Url::to(['manage/is_new', 'id' => $model->product_id]); 67 return \yii\helpers\Url::to(['manage/is_new', 'id' => $model->product_id]);
63 break; 68 break;
  69 + case 'akciya':
  70 + return \yii\helpers\Url::to(['manage/akciya', 'id' => $model->product_id]);
  71 + break;
64 case 'view': 72 case 'view':
65 return \yii\helpers\Url::to(['/catalog/product', 'id' => $model->product_id, ['target' => '_blank']]); 73 return \yii\helpers\Url::to(['/catalog/product', 'id' => $model->product_id, ['target' => '_blank']]);
66 break; 74 break;
common/modules/product/widgets/lastProducts.php 0 → 100644
  1 +<?php
  2 +
  3 +namespace common\modules\product\widgets;
  4 +
  5 +use common\modules\product\helpers\ProductHelper;
  6 +use common\modules\product\models\Category;
  7 +use yii\base\Widget;
  8 +
  9 +class lastProducts extends Widget {
  10 + public function init()
  11 + {
  12 + parent::init(); // TODO: Change the autogenerated stub
  13 + }
  14 +
  15 + public function run() {
  16 + return $this->render('products_block', [
  17 + 'title' => \Yii::t('product', 'Вы недавно просматривали'),
  18 + 'products' => ProductHelper::getLastProducts(true),
  19 + ]);
  20 + }
  21 +}
0 \ No newline at end of file 22 \ No newline at end of file
common/modules/product/widgets/specialProducts.php 0 → 100644
  1 +<?php
  2 +
  3 +namespace common\modules\product\widgets;
  4 +
  5 +use common\modules\product\helpers\ProductHelper;
  6 +use common\modules\product\models\Category;
  7 +use yii\base\Widget;
  8 +use Yii;
  9 +
  10 +class specialProducts extends Widget {
  11 + public $type = 'top';
  12 +
  13 + public $count = 4;
  14 +
  15 + public $sort = 'default';
  16 +
  17 + public $title;
  18 +
  19 + public function init()
  20 + {
  21 + parent::init(); // TODO: Change the autogenerated stub
  22 + }
  23 +
  24 + public function run() {
  25 + $products = ProductHelper::getSpecialProducts($this->type, $this->count, $this->sort);
  26 +
  27 + if (!$this->title) {
  28 + switch($this->type) {
  29 + case 'top':
  30 + $this->title = Yii::t('product', 'Top products');
  31 + break;
  32 + case 'promo':
  33 + $this->title = Yii::t('product', 'Promo products');
  34 + break;
  35 + case 'new':
  36 + $this->title = Yii::t('product', 'New products');
  37 + break;
  38 + }
  39 + }
  40 +
  41 + return $this->render('products_block', [
  42 + 'title' => $this->title,
  43 + 'products' => $products,
  44 + ]);
  45 + }
  46 +}
0 \ No newline at end of file 47 \ No newline at end of file
common/modules/product/widgets/views/brandsCarousel.php
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 <div class="prods_carousel"> 3 <div class="prods_carousel">
4 <ul> 4 <ul>
5 <?php foreach($brands as $brand) :?> 5 <?php foreach($brands as $brand) :?>
6 - <li><span><a href="<?= \yii\helpers\Url::to('/brands/'. $brand->alias)?>" title="<?= $brand->name?>"><?= $brand->imageFile ? Yii::$app->imageCache->thumb($brand->imageFile, 'brandlist') : ''?></a></span></li> 6 + <li><span><a href="<?= \yii\helpers\Url::to('/brands/'. $brand->alias)?>" title="<?= $brand->name?>"><?= $brand->imageFile ? \common\components\artboximage\ArtboxImageHelper::getImage($brand->imageFile, 'brandlist') : ''?></a></span></li>
7 <?php endforeach?> 7 <?php endforeach?>
8 </ul> 8 </ul>
9 </div> 9 </div>
common/modules/product/widgets/views/product_smart.php 0 → 100644
  1 +<?php
  2 +/** @var \common\modules\product\models\Product $product */
  3 +use yii\helpers\Url;
  4 +?>
  5 +<li class="item">
  6 + <div class="boxitem">
  7 + <div class="pixbox">
  8 + <a href="<?= Url::to([
  9 + 'catalog/product',
  10 + 'product' => $product])
  11 + ?>">
  12 + <?= \common\components\artboximage\ArtboxImageHelper::getImage($product->imageUrl, 'list')?>
  13 + </a>
  14 + </div>
  15 + <a href="<?= Url::to([
  16 + 'catalog/product',
  17 + 'product' => $product])
  18 + ?>" class="name"><?= $product->name ?>
  19 + </a>
  20 +
  21 + <?php
  22 +
  23 + echo '<div class="cost-block">';
  24 +
  25 + // есть скидка
  26 + if ($product->variant->price_old != 0 && $product->variant->price_old != $product->variant->price)
  27 + {
  28 + echo '<strike><span id=\'old_cost\'>'.$product->variant->price_old.'</span> грн.</strike>';
  29 + }
  30 +
  31 + echo '<p class="cost">'.$product->variant->price.' грн.</p>';
  32 +
  33 + echo '</div>';
  34 +
  35 + ?>
  36 + </div>
  37 + <a href="<?= Url::to([
  38 + 'catalog/product',
  39 + 'product' => $product])
  40 + ?>" class="link_buy">Купить</a>
  41 +
  42 + <div class="mycarousel">
  43 + <ul class="jcarousel jcarousel-skin-tango">
  44 + <?php foreach ($product->variants as $variant) : ?>
  45 + <li>
  46 + <a href="<?= Url::to([
  47 + 'catalog/product',
  48 + 'product' => $product,
  49 + '#' => 'm' . $variant->product_variant_id]) ?>">
  50 + <?= \common\components\artboximage\ArtboxImageHelper::getImage($variant->imageUrl, 'product_variant')?>
  51 + </a>
  52 + </li>
  53 + <?php endforeach; ?>
  54 + </ul>
  55 + </div>
  56 +</li>
0 \ No newline at end of file 57 \ No newline at end of file
common/modules/product/widgets/views/products_block.php 0 → 100644
  1 +<hr>
  2 +<div class="products">
  3 + <h3><?= $title?></h3>
  4 + <ul>
  5 + <?php foreach($products as $product) :?>
  6 + <?= $this->render('product_smart', ['product' => $product]);?>
  7 + <?php endforeach?>
  8 + </ul>
  9 + <div class="both"></div>
  10 +</div>
0 \ No newline at end of file 11 \ No newline at end of file
common/modules/product/widgets/views/submenu.php
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <?php if (empty($_item->image)) :?> 12 <?php if (empty($_item->image)) :?>
13 <img valign="top" src="/images/no_photo.png"> 13 <img valign="top" src="/images/no_photo.png">
14 <?php else :?> 14 <?php else :?>
15 - <?= $_item->imageUrl ? Yii::$app->imageCache->thumb($_item->imageUrl, 'mainmenu') : ''?> 15 + <?= $_item->imageUrl ? \common\components\artboximage\ArtboxImageHelper::getImage($_item->imageUrl, 'mainmenu') : ''?>
16 <?php endif?> 16 <?php endif?>
17 </div> 17 </div>
18 <div class="title"><?= $_item->categoryName->value?></div> 18 <div class="title"><?= $_item->categoryName->value?></div>
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 <?php if (empty($_item['item']->image)) :?> 34 <?php if (empty($_item['item']->image)) :?>
35 <img valign="top" src="/images/no_photo.png"> 35 <img valign="top" src="/images/no_photo.png">
36 <?php else :?> 36 <?php else :?>
37 - <?= $_item['item']->imageUrl ? Yii::$app->imageCache->thumb($_item['item']->imageUrl, 'mainmenu') : ''?> 37 + <?= $_item['item']->imageUrl ? \common\components\artboximage\ArtboxImageHelper::getImage($_item['item']->imageUrl, 'mainmenu') : ''?>
38 <?php endif?> 38 <?php endif?>
39 </div> 39 </div>
40 <div class="title"><?= $_item['item']->categoryName->value?></div> 40 <div class="title"><?= $_item['item']->categoryName->value?></div>
frontend/config/main.php
@@ -38,7 +38,7 @@ return [ @@ -38,7 +38,7 @@ return [
38 'errorHandler' => [ 38 'errorHandler' => [
39 'errorAction' => 'site/error', 39 'errorAction' => 'site/error',
40 ], 40 ],
41 - 'imageCache' => [ 41 + /*'imageCache' => [
42 'class' => 'iutbay\yii2imagecache\ImageCache', 42 'class' => 'iutbay\yii2imagecache\ImageCache',
43 'sourcePath' => '@app/web/images', 43 'sourcePath' => '@app/web/images',
44 'sourceUrl' => '@web/images', 44 'sourceUrl' => '@web/images',
@@ -56,7 +56,7 @@ return [ @@ -56,7 +56,7 @@ return [
56 'mainmenu' => [160, 170], 56 'mainmenu' => [160, 170],
57 'large' => [600, 600], 57 'large' => [600, 600],
58 ], 58 ],
59 - ], 59 + ],*/
60 'urlManager' => [ 60 'urlManager' => [
61 'enablePrettyUrl' => true, 61 'enablePrettyUrl' => true,
62 'showScriptName' => false, 62 'showScriptName' => false,
frontend/controllers/CatalogController.php
@@ -42,8 +42,6 @@ class CatalogController extends \yii\web\Controller @@ -42,8 +42,6 @@ class CatalogController extends \yii\web\Controller
42 throw new HttpException(404 ,'Page not found'); 42 throw new HttpException(404 ,'Page not found');
43 } 43 }
44 44
45 - $last_products = ProductHelper::getLastProducts(true);  
46 -  
47 if (!empty($word)) { 45 if (!empty($word)) {
48 $params = []; 46 $params = [];
49 47
@@ -73,7 +71,6 @@ class CatalogController extends \yii\web\Controller @@ -73,7 +71,6 @@ class CatalogController extends \yii\web\Controller
73 'category' => $category, 71 'category' => $category,
74 'productModel' => $productModel, 72 'productModel' => $productModel,
75 'productProvider' => $productProvider, 73 'productProvider' => $productProvider,
76 - 'last_products' => $last_products,  
77 'categories' => $categories, 74 'categories' => $categories,
78 ] 75 ]
79 ); 76 );
@@ -145,7 +142,6 @@ class CatalogController extends \yii\web\Controller @@ -145,7 +142,6 @@ class CatalogController extends \yii\web\Controller
145 'optionsProvider' => $optionsProvider, 142 'optionsProvider' => $optionsProvider,
146 'groups' => $groups, 143 'groups' => $groups,
147 'priceLimits' => $priceLimits, 144 'priceLimits' => $priceLimits,
148 - 'last_products' => $last_products,  
149 ] 145 ]
150 ); 146 );
151 } 147 }
@@ -169,14 +165,12 @@ class CatalogController extends \yii\web\Controller @@ -169,14 +165,12 @@ class CatalogController extends \yii\web\Controller
169 } 165 }
170 $category = $product->category; 166 $category = $product->category;
171 167
172 - $last_products = ProductHelper::getLastProducts(true);  
173 ProductHelper::addLastProsucts($product->product_id); 168 ProductHelper::addLastProsucts($product->product_id);
174 169
175 return $this->render('product', [ 170 return $this->render('product', [
176 'product' => $product, 171 'product' => $product,
177 'category' => $category, 172 'category' => $category,
178 'properties' => $groups, 173 'properties' => $groups,
179 - 'last_products' => $last_products  
180 ]); 174 ]);
181 } 175 }
182 176
frontend/models/ProductFrontendSearch.php
@@ -55,7 +55,9 @@ class ProductFrontendSearch extends Product { @@ -55,7 +55,9 @@ class ProductFrontendSearch extends Product {
55 $query->joinWith('brand'); 55 $query->joinWith('brand');
56 $query->joinWith('image'); 56 $query->joinWith('image');
57 $query->joinWith('categories'); 57 $query->joinWith('categories');
58 - $query->groupBy('product.product_id'); 58 + if (empty($_GET['sort']) || ($_GET['sort'] != 'price' && $_GET['sort'] != '-price')) {
  59 + $query->groupBy('product.product_id');
  60 + }
59 61
60 $dataProvider = new ActiveDataProvider([ 62 $dataProvider = new ActiveDataProvider([
61 'query' => $query, 63 'query' => $query,
frontend/views/catalog/product.php
@@ -102,10 +102,11 @@ $this-&gt;registerJs (&quot; @@ -102,10 +102,11 @@ $this-&gt;registerJs (&quot;
102 data-cost="<?= $variant->price ?>" 102 data-cost="<?= $variant->price ?>"
103 data-old_cost="<?= $variant->price_old ?>" data-id="<?= $variant->product_variant_id ?>" data-art="<?= $variant->sku ?>" 103 data-old_cost="<?= $variant->price_old ?>" data-id="<?= $variant->product_variant_id ?>" data-art="<?= $variant->sku ?>"
104 data-color="<?= $variant->name ?>" 104 data-color="<?= $variant->name ?>"
105 - data-image="<?= $variant->image->imageUrl ?>"  
106 - data-imageoriginal="<?= $variant->image->imageUrl ?>" 105 + data-image="<?= $variant->imageUrl ?>"
  106 + data-imageoriginal="<?= $variant->imageUrl ?>"
107 title="<?= $product->name ?>"> 107 title="<?= $product->name ?>">
108 - <?= Yii::$app->imageCache->thumb($variant->image->imageUrl, 'product_variant')?> 108 + <?= \common\components\artboximage\ArtboxImageHelper::getImage($variant->imageUrl, 'product_variant')?>
  109 +
109 </a> 110 </a>
110 </li> 111 </li>
111 <?php endforeach; ?> 112 <?php endforeach; ?>
@@ -157,13 +158,13 @@ $this-&gt;registerJs (&quot; @@ -157,13 +158,13 @@ $this-&gt;registerJs (&quot;
157 <div class="content"> 158 <div class="content">
158 <div class="pic"> 159 <div class="pic">
159 <center> 160 <center>
160 - <a href="#" rel="shadowbox[gal]" id="picoriginal"><?= Yii::$app->imageCache->thumb($product->image->imageUrl, 'product')?></a> 161 + <a href="#" rel="shadowbox[gal]" id="picoriginal"><?= \common\components\artboximage\ArtboxImageHelper::getImage($product->imageUrl, 'product')?></a>
161 </center> 162 </center>
162 </div> 163 </div>
163 <ul class="product_colors"> 164 <ul class="product_colors">
164 <?php foreach ($product->images as $image): ?> 165 <?php foreach ($product->images as $image): ?>
165 <li><a href="<?= $image->imageUrl ?>" rel="shadowbox[gal]"> 166 <li><a href="<?= $image->imageUrl ?>" rel="shadowbox[gal]">
166 - <?= Yii::$app->imageCache->thumb($image->imageUrl, 'product_trumb2')?> 167 + <?= \common\components\artboximage\ArtboxImageHelper::getImage($image->imageUrl, 'product_trumb2')?>
167 </a></li> 168 </a></li>
168 <?php endforeach; ?> 169 <?php endforeach; ?>
169 </ul> 170 </ul>
frontend/views/catalog/product_item.php
@@ -12,7 +12,7 @@ use yii\helpers\Url; @@ -12,7 +12,7 @@ use yii\helpers\Url;
12 <?php if (empty($product->image)) :?> 12 <?php if (empty($product->image)) :?>
13 <img src="/img/no_photo.png"> 13 <img src="/img/no_photo.png">
14 <?php else :?> 14 <?php else :?>
15 - <?= Yii::$app->imageCache->thumb($product->image->imageUrl, 'list')?> 15 + <?= \common\components\artboximage\ArtboxImageHelper::getImage($product->image->imageUrl, 'list')?>
16 <?php endif?> 16 <?php endif?>
17 </a> 17 </a>
18 </div> 18 </div>
@@ -52,7 +52,7 @@ use yii\helpers\Url; @@ -52,7 +52,7 @@ use yii\helpers\Url;
52 'catalog/product', 52 'catalog/product',
53 'product' => $product, 53 'product' => $product,
54 '#' => 'm' . $variant->product_variant_id]) ?>"> 54 '#' => 'm' . $variant->product_variant_id]) ?>">
55 - <?= Yii::$app->imageCache->thumb($variant->image->imageUrl, 'product_variant')?> 55 + <?= \common\components\artboximage\ArtboxImageHelper::getImage($variant->image->imageUrl, 'product_variant')?>
56 </a> 56 </a>
57 </li> 57 </li>
58 <?php endif; ?> 58 <?php endif; ?>
frontend/views/catalog/product_smart.php deleted
1 -<?php  
2 -/** @var \common\modules\product\models\Product $product */  
3 -  
4 -?>  
5 -<div class="my_custom_card">  
6 - <!--<div class="new">АКЦИЯ</div>  
7 - <div class="top">Toп</div>-->  
8 - <a href="<?= \yii\helpers\Url::to(['catalog/product', 'product' => $product])?>" class="item_link"><div class="pic"><img src="/images/no_photo.png"></div>  
9 - <div class="title_item"><?= $product->name?></div></a>  
10 - <?php if ($product->brand) :?>  
11 - <div class="brand">Бренд: <span><?= $product->brand->name?></span></div>  
12 - <?php endif?>  
13 - <div class="type"><?= implode(', ', $product->categoriesNames)?></div>  
14 - <?php if($product->variant) :?>  
15 - <div class="price"><?= $product->variant->price?> <span>грн.</span></div>  
16 - <button class="basket_add_but" data-id="<?= $product->variant->product_variant_id?>">в корзину</button>  
17 - <?php endif?>  
18 - <a href="#" class="compare_add_but" data-id="<?= $product->product_id?>"><span>добавить к сравнению</span></a>  
19 - <img class="item_bottom_img" src="/images/nc_item_bottom.png" alt="">  
20 -</div>  
21 \ No newline at end of file 0 \ No newline at end of file
frontend/views/catalog/products.php
@@ -128,6 +128,20 @@ $this-&gt;registerJsFile (Yii::getAlias(&#39;@web/js/ion.rangeSlider.js&#39;)); @@ -128,6 +128,20 @@ $this-&gt;registerJsFile (Yii::getAlias(&#39;@web/js/ion.rangeSlider.js&#39;));
128 128
129 <div class="content"> 129 <div class="content">
130 <h1><?= $category->name ?></h1> 130 <h1><?= $category->name ?></h1>
  131 + <div class="sort_menu">
  132 +
  133 + <div class="sort_block">
  134 + <span>Сортировка:</span>
  135 + <?= \yii\widgets\LinkSorter::widget([
  136 + 'sort' => $productProvider->sort,
  137 + 'attributes' => [
  138 + 'name',
  139 + 'price',
  140 + ]
  141 + ]);
  142 + ?>
  143 + </div>
  144 + </div>
131 <div class="products pn"> 145 <div class="products pn">
132 <ul> 146 <ul>
133 <?php foreach($productProvider->models as $product) :?> 147 <?php foreach($productProvider->models as $product) :?>
@@ -148,15 +162,5 @@ $this-&gt;registerJsFile (Yii::getAlias(&#39;@web/js/ion.rangeSlider.js&#39;)); @@ -148,15 +162,5 @@ $this-&gt;registerJsFile (Yii::getAlias(&#39;@web/js/ion.rangeSlider.js&#39;));
148 </div> 162 </div>
149 <div class="both"></div> 163 <div class="both"></div>
150 164
151 - <?php if(!empty($last_products)) :?>  
152 - <hr>  
153 - <div class="watched_block">  
154 - <h1>Вы недавно просматривали</h1>  
155 - <div class="flex-container">  
156 - <?php foreach($last_products as $product) :?>  
157 - <?php require(__DIR__ .'/product_smart.php')?>  
158 - <?php endforeach?>  
159 - </div>  
160 - </div>  
161 - <?php endif?> 165 + <?= \common\modules\product\widgets\lastProducts::widget()?>
162 </div> 166 </div>
163 \ No newline at end of file 167 \ No newline at end of file
frontend/views/catalog/search.php
@@ -122,15 +122,5 @@ $this-&gt;params[&#39;seo&#39;][&#39;key&#39;]= &#39;product_list&#39;; @@ -122,15 +122,5 @@ $this-&gt;params[&#39;seo&#39;][&#39;key&#39;]= &#39;product_list&#39;;
122 <?php endif?> 122 <?php endif?>
123 </div> 123 </div>
124 124
125 - <?php if(!empty($last_products)) :?>  
126 - <hr>  
127 - <div class="watched_block">  
128 - <h1>Вы недавно просматривали</h1>  
129 - <div class="flex-container">  
130 - <?php foreach($last_products as $product) :?>  
131 - <?php require(__DIR__ .'/product_smart.php')?>  
132 - <?php endforeach?>  
133 - </div>  
134 - </div>  
135 - <?php endif?> 125 + <?= \common\modules\product\widgets\lastProducts::widget()?>
136 </div> 126 </div>
137 \ No newline at end of file 127 \ No newline at end of file
frontend/views/layouts/main-menu.php
1 <?php 1 <?php
2 use common\modules\product\models\Category; 2 use common\modules\product\models\Category;
3 use yii\helpers\Url; 3 use yii\helpers\Url;
4 -use yii\widgets\Menu;  
5 -  
6 -  
7 -foreach (Category::find ()->all () as $category){  
8 - $categoryObject = Yii::$app->request->get('category');  
9 - $menu[] = ['label' => $category->name ,  
10 - 'url' => Url::to(['catalog/category', 'category' => $category]),  
11 - 'active' => isset($categoryObject) && $categoryObject->alias == $category->alias ? true : false ];  
12 -}  
13 -  
14 -$main_menu = Menu::widget([  
15 - 'items' => $menu,  
16 -]);  
17 ?> 4 ?>
18 5
19 -<?=$main_menu?> 6 +<?= \frontend\widgets\Rubrics::widget([])?>
20 <div class="fr"> 7 <div class="fr">
21 <ul> 8 <ul>
22 <li class="akciya"><a href="<?= Url::to (['event/index',]) ?>">Акции</a></li> 9 <li class="akciya"><a href="<?= Url::to (['event/index',]) ?>">Акции</a></li>
frontend/views/site/index.php
@@ -29,47 +29,12 @@ echo BannerWidget::widget([&#39;title&#39; =&gt; &#39;HOME_UNDER_SLIDER_3&#39;]); @@ -29,47 +29,12 @@ echo BannerWidget::widget([&#39;title&#39; =&gt; &#39;HOME_UNDER_SLIDER_3&#39;]);
29 echo '</div>'; 29 echo '</div>';
30 ?> 30 ?>
31 31
32 -<div class="rubrics">  
33 - <ul>  
34 - <li class="item1"><a href="<?= Url::to (['products/index', 'translit' => 'ryukzaki']) ?>">Рюкзаки</a></li>  
35 - <li class="item2"><a href="<?= Url::to (['products/index', 'translit' => 'sumki']) ?>">сумки</a></li>  
36 - <li class="item3"><a href="<?= Url::to (['products/index', 'translit' => 'chehly']) ?>">чехлы</a></li>  
37 - <li class="item4"><a href="<?= Url::to (['products/index', 'translit' => 'nesessery']) ?>">Несессеры</a></li>  
38 - <li class="item5"><a href="<?= Url::to (['products/index', 'translit' => 'koshelki']) ?>">кошельки</a></li>  
39 - </ul>  
40 - <div class="both"></div>  
41 -</div> 32 +<?= \frontend\widgets\Rubrics::widget(['wrapper' => 'rubrics'])?>
42 33
43 -<?php //TODO вставляем топ товары?>  
44 -<?// if (count ($products_top) > 0): ?>  
45 -<!-- <div class="products">-->  
46 -<!-- <h3>Топ товары</h3>-->  
47 -<!-- <ul>-->  
48 -<!---->  
49 -<!-- --><?// foreach ($products_top as $item): ?>  
50 -<!-- <li class="item">-->  
51 -<!-- --><?//= $this->render ('/products/_product', ['item' => $item, 'num' => 4]) ?>  
52 -<!-- </li>-->  
53 -<!-- --><?// endforeach; ?>  
54 -<!---->  
55 -<!-- </ul>-->  
56 -<!-- <div class="both"></div>-->  
57 -<!-- </div>-->  
58 -<?// endif; ?>  
59 -  
60 -  
61 -<div class="products">  
62 - <h3>Скидки</h3>  
63 - <ul>  
64 - <?php //TODO вставляем новинки?>  
65 - <!-- --><?// foreach ($products_new as $item): ?>  
66 - <!-- <li class="item">-->  
67 - <!-- --><?//= $this->render ('/products/_product', ['item' => $item, 'num' => 4]) ?>  
68 - <!-- </li>-->  
69 - <!-- --><?// endforeach; ?>  
70 - </ul>  
71 - <div class="both"></div>  
72 -</div> 34 +<?= \common\modules\product\widgets\specialProducts::widget(['type' => 'promo'])?>
  35 +<?= \common\modules\product\widgets\specialProducts::widget(['type' => 'new'])?>
  36 +<?= \common\modules\product\widgets\specialProducts::widget(['type' => 'top'])?>
  37 +<?= \common\modules\product\widgets\lastProducts::widget()?>
73 38
74 39
75 <h2 class="why"><span>Почему</span></h2> 40 <h2 class="why"><span>Почему</span></h2>
frontend/web/css/style.css
1 html,form, 1 html,form,
2 -body { padding:0;margin:0; 2 +body { padding:0px;margin:0px;
3 font-family: 'Roboto';font-size:14px;color:#1d1d1b;height:100%; 3 font-family: 'Roboto';font-size:14px;color:#1d1d1b;height:100%;
4 } 4 }
5 h1,h2,h3{margin:0px;padding:0px 0px 10px 0px;} 5 h1,h2,h3{margin:0px;padding:0px 0px 10px 0px;}
@@ -8,7 +8,7 @@ h1,h2,h3{margin:0px;padding:0px 0px 10px 0px;} @@ -8,7 +8,7 @@ h1,h2,h3{margin:0px;padding:0px 0px 10px 0px;}
8 .fotter .wrap .fr img{position: absolute; top: 50%; margin-top: -10px; right: 0;} 8 .fotter .wrap .fr img{position: absolute; top: 50%; margin-top: -10px; right: 0;}
9 .fotter .wrap .fl {line-height: 50px;} 9 .fotter .wrap .fl {line-height: 50px;}
10 .both{clear:both;} 10 .both{clear:both;}
11 -h1{margin:10px 0;font-size:24px;} 11 +h1{margin:10px 0px;font-size:24px;}
12 h3{margin-bottom:30px;} 12 h3{margin-bottom:30px;}
13 p{margin:3px 0px;padding:0px;} 13 p{margin:3px 0px;padding:0px;}
14 14
@@ -21,9 +21,9 @@ a:hover{color:#799920;} @@ -21,9 +21,9 @@ a:hover{color:#799920;}
21 .f{background: #ffffff;} 21 .f{background: #ffffff;}
22 22
23 .br{-webkit-box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46); 23 .br{-webkit-box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);
24 - -moz-box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);  
25 - box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);  
26 - padding:20px;} 24 +-moz-box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);
  25 +box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);
  26 +padding:20px;}
27 27
28 nav.top{background:#f5f5f5;padding:10px 0px;border-bottom:1px solid #d2d2d2;font-size:12px;} 28 nav.top{background:#f5f5f5;padding:10px 0px;border-bottom:1px solid #d2d2d2;font-size:12px;}
29 nav.top ul{list-style:none;margin:0px;padding:0px;} 29 nav.top ul{list-style:none;margin:0px;padding:0px;}
@@ -64,14 +64,10 @@ nav input[type=&quot;submit&quot;]{width:35px;height:29px;border:none;background:url(&#39;../i @@ -64,14 +64,10 @@ nav input[type=&quot;submit&quot;]{width:35px;height:29px;border:none;background:url(&#39;../i
64 .basket a:link,.basket a:visited{text-decoration:none;color:#000000;font-size:18px;} 64 .basket a:link,.basket a:visited{text-decoration:none;color:#000000;font-size:18px;}
65 65
66 .basket span.more {margin-bottom: -1px} 66 .basket span.more {margin-bottom: -1px}
67 -.menu{  
68 - background:#596065;  
69 - /*border:1px solid #e8e8e8;*/  
70 -} 67 +.menu{background:#596065;border:1px solid #e8e8e8;}
71 .menu ul{margin:0px;padding:0px;list-style:none;} 68 .menu ul{margin:0px;padding:0px;list-style:none;}
72 -.menu ul li{float:left;border-left:1px solid #e8e8e8;}  
73 -.menu ul li:first-child{border-left:none;}  
74 -.menu ul li a{float:left;padding:15px 20px 15px 20px;text-transform: uppercase;color:#ffffff;font-size:14px;text-decoration: none;} 69 +.menu ul li{float:left;border-right:1px solid #e8e8e8;}
  70 +.menu ul li a{float:left;padding:15px 20px 15px 20px;text-transform: uppercase;color:#ffffff;font-size:14px;font-weight:bold;text-decoration: none;}
75 .menu ul li a:hover{color:#e5e4e4;} 71 .menu ul li a:hover{color:#e5e4e4;}
76 .menu ul li.active a{background:#f5f5f5;color:#596065;} 72 .menu ul li.active a{background:#f5f5f5;color:#596065;}
77 73
@@ -83,7 +79,7 @@ nav input[type=&quot;submit&quot;]{width:35px;height:29px;border:none;background:url(&#39;../i @@ -83,7 +79,7 @@ nav input[type=&quot;submit&quot;]{width:35px;height:29px;border:none;background:url(&#39;../i
83 79
84 .fr ul li{border:none;} 80 .fr ul li{border:none;}
85 .akciya a{background:#f75d50;color:#ffffff;} 81 .akciya a{background:#f75d50;color:#ffffff;}
86 -.brands a{background:#95ba2f;color:#ffffff;} 82 +.brends a{background:#95ba2f;color:#ffffff;}
87 83
88 a.myorders{color:#f75d50} 84 a.myorders{color:#f75d50}
89 85
@@ -201,26 +197,26 @@ ul.product_colors li img{border:1px solid #d2d2d2;} @@ -201,26 +197,26 @@ ul.product_colors li img{border:1px solid #d2d2d2;}
201 197
202 198
203 .modal_box{ 199 .modal_box{
204 - position: fixed;  
205 - left: 0;  
206 - top: 0;  
207 - width: 100%;  
208 - height: 100%;  
209 - z-index: 999;  
210 -  
211 - background: #000;  
212 - filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50); /* IE 5.5+*/  
213 - -moz-opacity: 0.5; /* Mozilla 1.6 Р С‘ РЅРёР¶Рµ */  
214 - -khtml-opacity: 0.5; /* Konqueror 3.1, Safari 1.1 */  
215 - opacity: 0.5;  
216 - 200 + position: fixed;
  201 + left: 0;
  202 + top: 0;
  203 + width: 100%;
  204 + height: 100%;
  205 + z-index: 999;
  206 +
  207 + background: #000;
  208 +filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50); /* IE 5.5+*/
  209 +-moz-opacity: 0.5; /* Mozilla 1.6 Р С‘ РЅРёР¶Рµ */
  210 +-khtml-opacity: 0.5; /* Konqueror 3.1, Safari 1.1 */
  211 +opacity: 0.5;
  212 +
217 } 213 }
218 #data_box{position:absolute;top:100px;z-index:1000;width:400px;background:#ffffff; 214 #data_box{position:absolute;top:100px;z-index:1000;width:400px;background:#ffffff;
219 - -webkit-box-shadow: 0 0 15px #000;  
220 - -moz-box-shadow: 0 0 15px #000;  
221 - box-shadow: 0 0 15px #000;  
222 - border:7px solid #1b9bb6;  
223 - border-radius:5px; 215 + -webkit-box-shadow: 0 0 15px #000;
  216 + -moz-box-shadow: 0 0 15px #000;
  217 + box-shadow: 0 0 15px #000;
  218 + border:7px solid #1b9bb6;
  219 + border-radius:5px;
224 } 220 }
225 #data_box .data_wrp{padding:25px 15px 15px 15px;} 221 #data_box .data_wrp{padding:25px 15px 15px 15px;}
226 #data_box .data_wrp h1{text-transform: uppercase;} 222 #data_box .data_wrp h1{text-transform: uppercase;}
@@ -233,10 +229,10 @@ ul.product_colors li img{border:1px solid #d2d2d2;} @@ -233,10 +229,10 @@ ul.product_colors li img{border:1px solid #d2d2d2;}
233 .rightbar .control-label{float:left;width:80px;padding-top:5px;} 229 .rightbar .control-label{float:left;width:80px;padding-top:5px;}
234 .form-control{outline:0;border:1px solid #d8d6d6;border-radius:5px;padding:5px 0px 5px 0px;font-size:14px;text-indent:10px;margin-bottom:3px;width:250px;} 230 .form-control{outline:0;border:1px solid #d8d6d6;border-radius:5px;padding:5px 0px 5px 0px;font-size:14px;text-indent:10px;margin-bottom:3px;width:250px;}
235 .form-control:focus { 231 .form-control:focus {
236 - border:#1b9bb6 1px solid;  
237 - box-shadow: 0 0 10px #1b9bb6;  
238 - -webkit-box-shadow: 0 0 10px #1b9bb6;  
239 - -moz-box-shadow: 0 0 10px #1b9bb6; 232 +border:#1b9bb6 1px solid;
  233 +box-shadow: 0 0 10px #1b9bb6;
  234 +-webkit-box-shadow: 0 0 10px #1b9bb6;
  235 +-moz-box-shadow: 0 0 10px #1b9bb6;
240 } 236 }
241 .help-block{color:red;font-size:12px;margin-bottom:5px;} 237 .help-block{color:red;font-size:12px;margin-bottom:5px;}
242 238
@@ -341,22 +337,22 @@ ul.social {margin-top: 20px;} @@ -341,22 +337,22 @@ ul.social {margin-top: 20px;}
341 transition: all 0.5s ease-out; 337 transition: all 0.5s ease-out;
342 } 338 }
343 .social .fb{background-position:-44px 0; 339 .social .fb{background-position:-44px 0;
344 - cursor: pointer; 340 +cursor: pointer;
345 } 341 }
346 .social .vk{ 342 .social .vk{
347 - cursor: pointer; 343 +cursor: pointer;
348 } 344 }
349 .social .vk:hover{background-color:#5B7FA6;} 345 .social .vk:hover{background-color:#5B7FA6;}
350 .social .fb:hover{background-color:#354f89; 346 .social .fb:hover{background-color:#354f89;
351 } 347 }
352 .social .gp{background-position:-132px 0; 348 .social .gp{background-position:-132px 0;
353 - cursor: pointer;} 349 +cursor: pointer;}
354 .social .gp:hover{background-color:#c72f21;} 350 .social .gp:hover{background-color:#c72f21;}
355 .social .tw{background-position:-144px 0; 351 .social .tw{background-position:-144px 0;
356 - cursor: pointer;} 352 +cursor: pointer;}
357 .social .tw:hover{background-color:#6398c9;} 353 .social .tw:hover{background-color:#6398c9;}
358 .social .ok{background-position:-89px 0; 354 .social .ok{background-position:-89px 0;
359 - cursor: pointer;} 355 +cursor: pointer;}
360 .social .ok:hover{background-color:#f88f15;} 356 .social .ok:hover{background-color:#f88f15;}
361 .social ul li a:hover{ 357 .social ul li a:hover{
362 background-color:#065baa; 358 background-color:#065baa;
@@ -830,8 +826,8 @@ a.active{font-weight:bold;text-decoration: underline;} @@ -830,8 +826,8 @@ a.active{font-weight:bold;text-decoration: underline;}
830 -webkit-font-smoothing: antialiased; 826 -webkit-font-smoothing: antialiased;
831 } 827 }
832 .sort_block ul li a.asc:after { 828 .sort_block ul li a.asc:after {
833 - content: "↓"; 829 + content: "";
834 } 830 }
835 .sort_block ul li a.desc:after { 831 .sort_block ul li a.desc:after {
836 - content: "↑"; 832 + content: "";
837 } 833 }
838 \ No newline at end of file 834 \ No newline at end of file
frontend/web/images/no_photo.png 0 → 100644

9.21 KB

frontend/widgets/Rubrics.php 0 → 100644
  1 +<?php
  2 +
  3 +namespace frontend\widgets;
  4 +
  5 +use common\modules\product\models\Category;
  6 +use common\modules\product\models\CategorySearch;
  7 +use Yii;
  8 +use yii\base\Widget;
  9 +use yii\web\View;
  10 +use yii\helpers\Url;
  11 +
  12 +class Rubrics extends Widget {
  13 + public $active;
  14 +
  15 + public $wrapper = '';
  16 +
  17 + public function run()
  18 + {
  19 + if (!empty($this->active)) {
  20 + $this->active = Yii::$app->request->get('category');
  21 + }
  22 + if (!is_object($this->active)) {
  23 + $this->active = CategorySearch::findByAlias($this->active);
  24 + }
  25 + if (!empty($this->active)) {
  26 + $this->active = $this->active->category_id;
  27 + }
  28 + $items = [];
  29 + foreach (Category::find ()->all () as $category) {
  30 + $items[] = $category;[
  31 + 'label' => $category->name ,
  32 + 'url' => Url::to(['catalog/category', 'category' => $category]),
  33 + 'active' => !empty($categoryObject) && $categoryObject->alias == $category->alias ? true : false,
  34 + ];
  35 + }
  36 +
  37 + return $this->render('rubrics', ['items' => $items, 'wrapper' => $this->wrapper, 'active' => $this->active]);
  38 + }
  39 +}
0 \ No newline at end of file 40 \ No newline at end of file
frontend/widgets/views/rubrics.php 0 → 100644
  1 +<?php
  2 +use yii\widgets\Menu;
  3 +?>
  4 +<?php if(!empty($wrapper)) :?>
  5 +<div class="<?= $wrapper?>">
  6 +<?php endif?>
  7 +<ul>
  8 + <?= $active?>
  9 +<?php foreach($items as $i => $category) :?>
  10 + <li class="item<?= $category->alias?><?= ($active == $category->category_id ? ' active' : '')?>"><?= \yii\helpers\Html::a($category->name, ['catalog/category', 'category' => $category])?></li>
  11 +<?php endforeach;?>
  12 +</ul>
  13 +<?php if(!empty($wrapper)) :?>
  14 + <div class="both"></div>
  15 +</div>
  16 +<?php endif?>
0 \ No newline at end of file 17 \ No newline at end of file