diff --git a/backend/views/slider-image/_form.php b/backend/views/slider-image/_form.php
index eb686c6..6fb53b8 100755
--- a/backend/views/slider-image/_form.php
+++ b/backend/views/slider-image/_form.php
@@ -23,7 +23,7 @@ use yii\widgets\ActiveForm;
],
'pluginOptions' => [
'allowedFileExtensions' => ['jpg','gif','png'],
- 'initialPreview' => $model->imageUrl ? Yii::$app->imageCache->thumb($model->imageUrl, 'slider') : '',
+ 'initialPreview' => $model->imageUrl ? \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'slider') : '',
'overwriteInitial' => true,
'showRemove' => true,
'showUpload' => false,
diff --git a/backend/web/css/site.css b/backend/web/css/site.css
index 034d162..f12dcf0 100755
--- a/backend/web/css/site.css
+++ b/backend/web/css/site.css
@@ -1,3 +1,5 @@
+@import url("//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css");
+
html,
body {
height: 100%;
diff --git a/common/config/main.php b/common/config/main.php
index 19fe58d..91bcbce 100755
--- a/common/config/main.php
+++ b/common/config/main.php
@@ -75,49 +75,46 @@ return [
'height' => 300,
'master' => null
],
- /*'flip' => [
- 'direction' => \common\components\artboximage\drivers\Image::HORIZONTAL
- ]*/
],
- 'brandlist' => [
+ 'product_variant' => [
'resize' => [
- 'width' => 138,
- 'height' => 78,
+ 'width' => 44,
+ 'height' => 44,
'master' => null
],
],
- 'product_trumb' => [
+ 'product_trumb2' => [
'resize' => [
- 'width' => 80,
- 'height' => 80,
+ 'width' => 100,
+ 'height' => 100,
'master' => null
],
],
- 'product_variant' => [
+ 'slider' => [
'resize' => [
- 'width' => 44,
- 'height' => 44,
+ 'width' => 720,
+ 'height' => 340,
'master' => null
],
],
- 'product_list' => [
+ 'brandlist' => [
'resize' => [
- 'width' => 130,
- 'height' => 70,
+ 'width' => 128,
+ 'height' => 128,
'master' => null
],
],
- 'product_list2' => [
+ 'mainmenu' => [
'resize' => [
- 'width' => 130,
- 'height' => 70,
+ 'width' => 160,
+ 'height' => 170,
'master' => null
],
],
- 'mainmenu' => [
+ 'list' => [
'resize' => [
- 'width' => 160,
- 'height' => 170,
+ 'width' => 134,
+ 'height' => 200,
'master' => null
],
],
diff --git a/common/models/Share.php b/common/models/Share.php
new file mode 100644
index 0000000..8a2eb57
--- /dev/null
+++ b/common/models/Share.php
@@ -0,0 +1,44 @@
+ 'Название',
+ 'date_time'=>'Дата',
+ ];
+ }
+
+ public function beforeSave($insert) {
+ $this->user_id = Yii::$app->user->id;
+ $this->date_time = time();
+ $this->date = new \yii\db\Expression('NOW()');
+ return parent::beforeSave($insert);
+ }
+
+ public function beforeDelete() {
+ return parent::beforeDelete();
+ }
+
+ public function getProduct()
+ {
+ return $this->hasOne(Products::className(), ['id' => 'product_id']);
+ }
+
+ public function getShareList()
+ {
+ return $this->hasMany(self::className(), ['date' => 'date'])->where(['user_id'=>Yii::$app->user->id])->orderBy('id DESC');
+ }
+
+}
diff --git a/common/modules/product/controllers/ManageController.php b/common/modules/product/controllers/ManageController.php
index 6f37b7d..a00ae0e 100755
--- a/common/modules/product/controllers/ManageController.php
+++ b/common/modules/product/controllers/ManageController.php
@@ -127,7 +127,7 @@ class ManageController extends Controller
if ($model->load(Yii::$app->request->post())) {
$model->imagesUpload = UploadedFile::getInstances($model, 'imagesUpload');
- if ($model->save()) {
+ if ($model->save() && $model->imagesUpload) {
foreach ($model->images as $image) {
$image->delete();
}
@@ -214,6 +214,36 @@ class ManageController extends Controller
exit;
}
+ public function actionIs_top($id) {
+ $model = $this->findModel($id);
+
+ $model->is_top = intval(empty($model->is_top));
+
+ $model->save(false, ['is_top']);
+
+ return $this->redirect(['index']);
+ }
+
+ public function actionIs_new($id) {
+ $model = $this->findModel($id);
+
+ $model->is_new = intval(empty($model->is_new));
+
+ $model->save(false, ['is_new']);
+
+ return $this->redirect(['index']);
+ }
+
+ public function actionAkciya($id) {
+ $model = $this->findModel($id);
+
+ $model->akciya = intval(empty($model->akciya));
+
+ $model->save(false, ['akciya']);
+
+ return $this->redirect(['index']);
+ }
+
public function actionImport() {
$searchModel = new RemoteProductsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
diff --git a/common/modules/product/helpers/ProductHelper.php b/common/modules/product/helpers/ProductHelper.php
index 500cc09..f8a6ec2 100755
--- a/common/modules/product/helpers/ProductHelper.php
+++ b/common/modules/product/helpers/ProductHelper.php
@@ -69,8 +69,23 @@ class ProductHelper extends Object {
public static function getLastProducts($as_object = false) {
$last_products = Yii::$app->session->get('last_products', []);
if ($as_object) {
- $last_products = Product::find()->where(['product_id' => $last_products])->all();
+ $last_products = array_reverse(Product::find()->where(['product_id' => $last_products])->all());
}
return $last_products;
}
+
+ public static function getSpecialProducts($type, $count, $sort = null) {
+ switch($type) {
+ case 'top':
+ $data = ['is_top' => true];
+ break;
+ case 'new':
+ $data = ['is_new' => true];
+ break;
+ case 'promo':
+ $data = ['akciya' => true];
+ break;
+ }
+ return Product::find()->where($data)->limit($count)/*->orderBy($sort)*/->all();
+ }
}
\ No newline at end of file
diff --git a/common/modules/product/models/Product.php b/common/modules/product/models/Product.php
index 3e3b7ad..e1fb8bc 100755
--- a/common/modules/product/models/Product.php
+++ b/common/modules/product/models/Product.php
@@ -24,6 +24,7 @@ use yii\web\UploadedFile;
* @property array $images
* @property boolean $is_top
* @property boolean $is_new
+ * @property boolean $akciya
*/
class Product extends \yii\db\ActiveRecord
{
@@ -72,9 +73,9 @@ class Product extends \yii\db\ActiveRecord
[['name'], 'string', 'max' => 150],
[['alias'], 'string', 'max' => 250],
[['categories', 'variants', 'options', 'imagesUpload'], 'safe'],
- [['imagesUpload'], 'file', 'skipOnEmpty' => false, 'extensions' => 'png, jpg, gif', 'maxFiles' => 50],
+// [['imagesUpload'], 'file', 'skipOnEmpty' => false, 'extensions' => 'png, jpg, gif', 'maxFiles' => 50],
[['description', 'video'], 'safe'],
- [['is_top', 'is_new'], 'boolean'],
+ [['is_top', 'is_new', 'akciya'], 'boolean'],
// [['product_id'], 'exist', 'skipOnError' => true, 'targetClass' => Product::className(), 'targetAttribute' => ['product_id' => 'product_id']],
];
}
@@ -97,6 +98,7 @@ class Product extends \yii\db\ActiveRecord
'variants' => Yii::t('product', 'Variants'),
'is_top' => Yii::t('product', 'Is top'),
'is_new' => Yii::t('product', 'Is new'),
+ 'akciya' => Yii::t('product', 'Is promo'),
];
}
@@ -117,6 +119,16 @@ class Product extends \yii\db\ActiveRecord
}
/**
+ * fetch stored image url
+ * @return string
+ */
+ public function getImageUrl()
+ {
+ // return a default image placeholder if your source image is not found
+ return !empty($this->image) ? $this->image->imageUrl : '/images/no_photo.png';
+ }
+
+ /**
* @return \yii\db\ActiveQuery
*/
public function getImages()
@@ -200,7 +212,7 @@ class Product extends \yii\db\ActiveRecord
//
// }
- $todel = [];
+ /*$todel = [];
foreach ($this->variants ? : [] as $_variant) {
$todel[$_variant->product_variant_id] = $_variant->product_variant_id;
}
@@ -220,7 +232,7 @@ class Product extends \yii\db\ActiveRecord
}
if (!empty($todel)) {
ProductVariant::deleteAll(['product_variant_id' => $todel]);
- }
+ }*/
}
public function imagesUpload()
diff --git a/common/modules/product/models/ProductImage.php b/common/modules/product/models/ProductImage.php
index 8612ff5..865be00 100755
--- a/common/modules/product/models/ProductImage.php
+++ b/common/modules/product/models/ProductImage.php
@@ -107,7 +107,7 @@ class ProductImage extends \yii\db\ActiveRecord
public function getImageUrl()
{
// return a default image placeholder if your source image is not found
- return isset($this->image) ? '/images/products/'. $this->image : 'default.jpg';
+ return isset($this->image) ? '/images/products/'. $this->image : '/images/no_photo.png';
}
/**
diff --git a/common/modules/product/models/ProductSearch.php b/common/modules/product/models/ProductSearch.php
index 8bfe7a8..e464f72 100755
--- a/common/modules/product/models/ProductSearch.php
+++ b/common/modules/product/models/ProductSearch.php
@@ -72,18 +72,32 @@ class ProductSearch extends Product
$query->joinWith(['brand', 'brand.brandNames', 'categories', 'categories.categoryNames']);
- // grid filtering conditions
+ if (isset($this->is_top)) {
+ $query->andFilterWhere([
+ 'is_top' => (bool)$this->is_top,
+ ]);
+ }
+ if (isset($this->is_new)) {
+ $query->andFilterWhere([
+ 'is_new' => (bool)$this->is_new,
+ ]);
+ }
+ if (isset($this->akciya)) {
+ $query->andFilterWhere([
+ 'akciya' => (bool)$this->akciya,
+ ]);
+ }
$query->andFilterWhere([
'tax_brand_id' => $this->tax_brand_id,
'product_id' => $this->product_id,
- 'is_top' => (bool)$this->is_top,
- 'is_new' => (bool)$this->is_new,
]);
$query->andFilterWhere(['ilike', 'name', $this->name]);
$query->andFilterWhere(['ilike', 'brand_name.value', $this->brand_name]);
$query->andFilterWhere(['ilike', 'category_name.value', $this->category_name]);
+ $query->orderBy('product.product_id', 'DESC');
+
return $dataProvider;
}
diff --git a/common/modules/product/models/ProductVariant.php b/common/modules/product/models/ProductVariant.php
index e6fbfbb..beaca7d 100755
--- a/common/modules/product/models/ProductVariant.php
+++ b/common/modules/product/models/ProductVariant.php
@@ -123,6 +123,16 @@ class ProductVariant extends \yii\db\ActiveRecord
}
/**
+ * fetch stored image url
+ * @return string
+ */
+ public function getImageUrl()
+ {
+ // return a default image placeholder if your source image is not found
+ return !empty($this->image) ? $this->image->imageUrl : '/images/no_photo.png';
+ }
+
+ /**
* @return \yii\db\ActiveQuery
*/
public function getImages()
diff --git a/common/modules/product/views/manage/_form.php b/common/modules/product/views/manage/_form.php
index 8a782d4..13cac75 100755
--- a/common/modules/product/views/manage/_form.php
+++ b/common/modules/product/views/manage/_form.php
@@ -23,6 +23,9 @@ use kartik\select2\Select2;
= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
+ = $form->field($model, 'is_top')->checkbox() ?>
+ = $form->field($model, 'is_new')->checkbox() ?>
+
= $form->field($model, 'description')->widget(\mihaildev\ckeditor\CKEditor::className(),['editorOptions' => [ 'preset' => 'full', 'inline' => false, ], ]); ?>
= $form->field($model, 'video')->textarea(); ?>
diff --git a/common/modules/product/views/manage/index.php b/common/modules/product/views/manage/index.php
index 3dde594..35456dc 100755
--- a/common/modules/product/views/manage/index.php
+++ b/common/modules/product/views/manage/index.php
@@ -40,7 +40,7 @@ $this->params['breadcrumbs'][] = $this->title;
[
'class' => 'yii\grid\ActionColumn',
- 'template' => '{view} {is_top} {is_new} {update} {delete}',
+ 'template' => '{view} |{is_top} {is_new} {akciya} | {update} {delete}',
'buttons' => [
'is_top' => function ($url, $model) {
return Html::a(' ', $url, [
@@ -52,6 +52,11 @@ $this->params['breadcrumbs'][] = $this->title;
'title' => Yii::t('product', ($model->is_new ? 'Set not is new' : 'Set is new')),
]);
},
+ 'akciya' => function ($url, $model) {
+ return Html::a(' ', $url, [
+ 'title' => Yii::t('product', ($model->akciya ? 'Set not is promotion' : 'Set is promotion')),
+ ]);
+ },
],
'urlCreator' => function ($action, $model, $key, $index) {
switch ($action) {
@@ -61,6 +66,9 @@ $this->params['breadcrumbs'][] = $this->title;
case 'is_new':
return \yii\helpers\Url::to(['manage/is_new', 'id' => $model->product_id]);
break;
+ case 'akciya':
+ return \yii\helpers\Url::to(['manage/akciya', 'id' => $model->product_id]);
+ break;
case 'view':
return \yii\helpers\Url::to(['/catalog/product', 'id' => $model->product_id, ['target' => '_blank']]);
break;
diff --git a/common/modules/product/widgets/lastProducts.php b/common/modules/product/widgets/lastProducts.php
new file mode 100644
index 0000000..225b655
--- /dev/null
+++ b/common/modules/product/widgets/lastProducts.php
@@ -0,0 +1,21 @@
+render('products_block', [
+ 'title' => \Yii::t('product', 'Вы недавно просматривали'),
+ 'products' => ProductHelper::getLastProducts(true),
+ ]);
+ }
+}
\ No newline at end of file
diff --git a/common/modules/product/widgets/specialProducts.php b/common/modules/product/widgets/specialProducts.php
new file mode 100644
index 0000000..3f0d5c0
--- /dev/null
+++ b/common/modules/product/widgets/specialProducts.php
@@ -0,0 +1,46 @@
+type, $this->count, $this->sort);
+
+ if (!$this->title) {
+ switch($this->type) {
+ case 'top':
+ $this->title = Yii::t('product', 'Top products');
+ break;
+ case 'promo':
+ $this->title = Yii::t('product', 'Promo products');
+ break;
+ case 'new':
+ $this->title = Yii::t('product', 'New products');
+ break;
+ }
+ }
+
+ return $this->render('products_block', [
+ 'title' => $this->title,
+ 'products' => $products,
+ ]);
+ }
+}
\ No newline at end of file
diff --git a/common/modules/product/widgets/views/brandsCarousel.php b/common/modules/product/widgets/views/brandsCarousel.php
index abb869e..0d76762 100755
--- a/common/modules/product/widgets/views/brandsCarousel.php
+++ b/common/modules/product/widgets/views/brandsCarousel.php
@@ -3,7 +3,7 @@
diff --git a/common/modules/product/widgets/views/product_smart.php b/common/modules/product/widgets/views/product_smart.php
new file mode 100644
index 0000000..000591e
--- /dev/null
+++ b/common/modules/product/widgets/views/product_smart.php
@@ -0,0 +1,56 @@
+
+
+
+
+
= $product->name ?>
+
+
+ ';
+
+ // есть скидка
+ if ($product->variant->price_old != 0 && $product->variant->price_old != $product->variant->price)
+ {
+ echo '
'.$product->variant->price_old.' грн.';
+ }
+
+ echo '
'.$product->variant->price.' грн.
';
+
+ echo '
';
+
+ ?>
+
+ Купить
+
+
+
\ No newline at end of file
diff --git a/common/modules/product/widgets/views/products_block.php b/common/modules/product/widgets/views/products_block.php
new file mode 100644
index 0000000..3c5370c
--- /dev/null
+++ b/common/modules/product/widgets/views/products_block.php
@@ -0,0 +1,10 @@
+
+
+
= $title?>
+
+
+ = $this->render('product_smart', ['product' => $product]);?>
+
+
+
+
\ No newline at end of file
diff --git a/common/modules/product/widgets/views/submenu.php b/common/modules/product/widgets/views/submenu.php
index 14520ad..1a5a82f 100755
--- a/common/modules/product/widgets/views/submenu.php
+++ b/common/modules/product/widgets/views/submenu.php
@@ -12,7 +12,7 @@
image)) :?>
- = $_item->imageUrl ? Yii::$app->imageCache->thumb($_item->imageUrl, 'mainmenu') : ''?>
+ = $_item->imageUrl ? \common\components\artboximage\ArtboxImageHelper::getImage($_item->imageUrl, 'mainmenu') : ''?>
= $_item->categoryName->value?>
@@ -34,7 +34,7 @@
image)) :?>
- = $_item['item']->imageUrl ? Yii::$app->imageCache->thumb($_item['item']->imageUrl, 'mainmenu') : ''?>
+ = $_item['item']->imageUrl ? \common\components\artboximage\ArtboxImageHelper::getImage($_item['item']->imageUrl, 'mainmenu') : ''?>
= $_item['item']->categoryName->value?>
diff --git a/frontend/config/main.php b/frontend/config/main.php
index 2d867d5..01e3ca9 100755
--- a/frontend/config/main.php
+++ b/frontend/config/main.php
@@ -38,7 +38,7 @@ return [
'errorHandler' => [
'errorAction' => 'site/error',
],
- 'imageCache' => [
+ /*'imageCache' => [
'class' => 'iutbay\yii2imagecache\ImageCache',
'sourcePath' => '@app/web/images',
'sourceUrl' => '@web/images',
@@ -56,7 +56,7 @@ return [
'mainmenu' => [160, 170],
'large' => [600, 600],
],
- ],
+ ],*/
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
diff --git a/frontend/controllers/CatalogController.php b/frontend/controllers/CatalogController.php
index 4550047..2d919ef 100755
--- a/frontend/controllers/CatalogController.php
+++ b/frontend/controllers/CatalogController.php
@@ -42,8 +42,6 @@ class CatalogController extends \yii\web\Controller
throw new HttpException(404 ,'Page not found');
}
- $last_products = ProductHelper::getLastProducts(true);
-
if (!empty($word)) {
$params = [];
@@ -73,7 +71,6 @@ class CatalogController extends \yii\web\Controller
'category' => $category,
'productModel' => $productModel,
'productProvider' => $productProvider,
- 'last_products' => $last_products,
'categories' => $categories,
]
);
@@ -145,7 +142,6 @@ class CatalogController extends \yii\web\Controller
'optionsProvider' => $optionsProvider,
'groups' => $groups,
'priceLimits' => $priceLimits,
- 'last_products' => $last_products,
]
);
}
@@ -169,14 +165,12 @@ class CatalogController extends \yii\web\Controller
}
$category = $product->category;
- $last_products = ProductHelper::getLastProducts(true);
ProductHelper::addLastProsucts($product->product_id);
return $this->render('product', [
'product' => $product,
'category' => $category,
'properties' => $groups,
- 'last_products' => $last_products
]);
}
diff --git a/frontend/models/ProductFrontendSearch.php b/frontend/models/ProductFrontendSearch.php
index 27a67c2..1ab4a0d 100755
--- a/frontend/models/ProductFrontendSearch.php
+++ b/frontend/models/ProductFrontendSearch.php
@@ -55,7 +55,9 @@ class ProductFrontendSearch extends Product {
$query->joinWith('brand');
$query->joinWith('image');
$query->joinWith('categories');
- $query->groupBy('product.product_id');
+ if (empty($_GET['sort']) || ($_GET['sort'] != 'price' && $_GET['sort'] != '-price')) {
+ $query->groupBy('product.product_id');
+ }
$dataProvider = new ActiveDataProvider([
'query' => $query,
diff --git a/frontend/views/catalog/product.php b/frontend/views/catalog/product.php
index 7bb8053..22247cb 100755
--- a/frontend/views/catalog/product.php
+++ b/frontend/views/catalog/product.php
@@ -102,10 +102,11 @@ $this->registerJs ("
data-cost="= $variant->price ?>"
data-old_cost="= $variant->price_old ?>" data-id="= $variant->product_variant_id ?>" data-art="= $variant->sku ?>"
data-color="= $variant->name ?>"
- data-image="= $variant->image->imageUrl ?>"
- data-imageoriginal="= $variant->image->imageUrl ?>"
+ data-image="= $variant->imageUrl ?>"
+ data-imageoriginal="= $variant->imageUrl ?>"
title="= $product->name ?>">
- = Yii::$app->imageCache->thumb($variant->image->imageUrl, 'product_variant')?>
+ = \common\components\artboximage\ArtboxImageHelper::getImage($variant->imageUrl, 'product_variant')?>
+
@@ -157,13 +158,13 @@ $this->registerJs ("
diff --git a/frontend/views/catalog/product_item.php b/frontend/views/catalog/product_item.php
index de19184..e12e56b 100755
--- a/frontend/views/catalog/product_item.php
+++ b/frontend/views/catalog/product_item.php
@@ -12,7 +12,7 @@ use yii\helpers\Url;
image)) :?>
- = Yii::$app->imageCache->thumb($product->image->imageUrl, 'list')?>
+ = \common\components\artboximage\ArtboxImageHelper::getImage($product->image->imageUrl, 'list')?>
@@ -52,7 +52,7 @@ use yii\helpers\Url;
'catalog/product',
'product' => $product,
'#' => 'm' . $variant->product_variant_id]) ?>">
- = Yii::$app->imageCache->thumb($variant->image->imageUrl, 'product_variant')?>
+ = \common\components\artboximage\ArtboxImageHelper::getImage($variant->image->imageUrl, 'product_variant')?>
diff --git a/frontend/views/catalog/product_smart.php b/frontend/views/catalog/product_smart.php
deleted file mode 100755
index a0313e4..0000000
--- a/frontend/views/catalog/product_smart.php
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
- = $product->name?>
- brand) :?>
-
Бренд: = $product->brand->name?>
-
-
= implode(', ', $product->categoriesNames)?>
- variant) :?>
-
= $product->variant->price?> грн.
-
в корзину
-
-
добавить к сравнению
-
-
\ No newline at end of file
diff --git a/frontend/views/catalog/products.php b/frontend/views/catalog/products.php
index a29a158..0cb2121 100755
--- a/frontend/views/catalog/products.php
+++ b/frontend/views/catalog/products.php
@@ -128,6 +128,20 @@ $this->registerJsFile (Yii::getAlias('@web/js/ion.rangeSlider.js'));
= $category->name ?>
+
models as $product) :?>
@@ -148,15 +162,5 @@ $this->registerJsFile (Yii::getAlias('@web/js/ion.rangeSlider.js'));
-
-
-
-
Вы недавно просматривали
-
-
-
-
-
-
-
+ = \common\modules\product\widgets\lastProducts::widget()?>
\ No newline at end of file
diff --git a/frontend/views/catalog/search.php b/frontend/views/catalog/search.php
index db193fe..8c3db7f 100755
--- a/frontend/views/catalog/search.php
+++ b/frontend/views/catalog/search.php
@@ -122,15 +122,5 @@ $this->params['seo']['key']= 'product_list';
-
-
-
-
Вы недавно просматривали
-
-
-
-
-
-
-
+ = \common\modules\product\widgets\lastProducts::widget()?>
\ No newline at end of file
diff --git a/frontend/views/layouts/main-menu.php b/frontend/views/layouts/main-menu.php
index ffe8052..0dd0761 100644
--- a/frontend/views/layouts/main-menu.php
+++ b/frontend/views/layouts/main-menu.php
@@ -1,22 +1,9 @@
all () as $category){
- $categoryObject = Yii::$app->request->get('category');
- $menu[] = ['label' => $category->name ,
- 'url' => Url::to(['catalog/category', 'category' => $category]),
- 'active' => isset($categoryObject) && $categoryObject->alias == $category->alias ? true : false ];
-}
-
-$main_menu = Menu::widget([
- 'items' => $menu,
-]);
?>
-=$main_menu?>
+= \frontend\widgets\Rubrics::widget([])?>
Акции
diff --git a/frontend/views/site/index.php b/frontend/views/site/index.php
index bb02af6..b3de44e 100755
--- a/frontend/views/site/index.php
+++ b/frontend/views/site/index.php
@@ -29,47 +29,12 @@ echo BannerWidget::widget(['title' => 'HOME_UNDER_SLIDER_3']);
echo ' ';
?>
-
+= \frontend\widgets\Rubrics::widget(['wrapper' => 'rubrics'])?>
-
-// if (count ($products_top) > 0): ?>
-
-
-
-
-// foreach ($products_top as $item): ?>
-
-//= $this->render ('/products/_product', ['item' => $item, 'num' => 4]) ?>
-
-// endforeach; ?>
-
-
-
-
-// endif; ?>
-
-
-
-
Скидки
-
-
- // foreach ($products_new as $item): ?>
-
- //= $this->render ('/products/_product', ['item' => $item, 'num' => 4]) ?>
-
- // endforeach; ?>
-
-
-
+= \common\modules\product\widgets\specialProducts::widget(['type' => 'promo'])?>
+= \common\modules\product\widgets\specialProducts::widget(['type' => 'new'])?>
+= \common\modules\product\widgets\specialProducts::widget(['type' => 'top'])?>
+= \common\modules\product\widgets\lastProducts::widget()?>
Почему
diff --git a/frontend/web/css/style.css b/frontend/web/css/style.css
index 9ae7294..eaf2c81 100755
--- a/frontend/web/css/style.css
+++ b/frontend/web/css/style.css
@@ -1,5 +1,5 @@
html,form,
-body { padding:0;margin:0;
+body { padding:0px;margin:0px;
font-family: 'Roboto';font-size:14px;color:#1d1d1b;height:100%;
}
h1,h2,h3{margin:0px;padding:0px 0px 10px 0px;}
@@ -8,7 +8,7 @@ h1,h2,h3{margin:0px;padding:0px 0px 10px 0px;}
.fotter .wrap .fr img{position: absolute; top: 50%; margin-top: -10px; right: 0;}
.fotter .wrap .fl {line-height: 50px;}
.both{clear:both;}
-h1{margin:10px 0;font-size:24px;}
+h1{margin:10px 0px;font-size:24px;}
h3{margin-bottom:30px;}
p{margin:3px 0px;padding:0px;}
@@ -21,9 +21,9 @@ a:hover{color:#799920;}
.f{background: #ffffff;}
.br{-webkit-box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);
- -moz-box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);
- box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);
- padding:20px;}
+-moz-box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);
+box-shadow: -1px 5px 14px 0px rgba(50, 46, 50, 0.46);
+padding:20px;}
nav.top{background:#f5f5f5;padding:10px 0px;border-bottom:1px solid #d2d2d2;font-size:12px;}
nav.top ul{list-style:none;margin:0px;padding:0px;}
@@ -64,14 +64,10 @@ nav input[type="submit"]{width:35px;height:29px;border:none;background:url('../i
.basket a:link,.basket a:visited{text-decoration:none;color:#000000;font-size:18px;}
.basket span.more {margin-bottom: -1px}
-.menu{
- background:#596065;
- /*border:1px solid #e8e8e8;*/
-}
+.menu{background:#596065;border:1px solid #e8e8e8;}
.menu ul{margin:0px;padding:0px;list-style:none;}
-.menu ul li{float:left;border-left:1px solid #e8e8e8;}
-.menu ul li:first-child{border-left:none;}
-.menu ul li a{float:left;padding:15px 20px 15px 20px;text-transform: uppercase;color:#ffffff;font-size:14px;text-decoration: none;}
+.menu ul li{float:left;border-right:1px solid #e8e8e8;}
+.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;}
.menu ul li a:hover{color:#e5e4e4;}
.menu ul li.active a{background:#f5f5f5;color:#596065;}
@@ -83,7 +79,7 @@ nav input[type="submit"]{width:35px;height:29px;border:none;background:url('../i
.fr ul li{border:none;}
.akciya a{background:#f75d50;color:#ffffff;}
-.brands a{background:#95ba2f;color:#ffffff;}
+.brends a{background:#95ba2f;color:#ffffff;}
a.myorders{color:#f75d50}
@@ -201,26 +197,26 @@ ul.product_colors li img{border:1px solid #d2d2d2;}
.modal_box{
- position: fixed;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- z-index: 999;
-
- background: #000;
- filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50); /* IE 5.5+*/
- -moz-opacity: 0.5; /* Mozilla 1.6 РС‘ РР…РС‘РВ¶РВµ */
- -khtml-opacity: 0.5; /* Konqueror 3.1, Safari 1.1 */
- opacity: 0.5;
-
+ position: fixed;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 999;
+
+ background: #000;
+filter:progid:DXImageTransform.Microsoft.Alpha(opacity=50); /* IE 5.5+*/
+-moz-opacity: 0.5; /* Mozilla 1.6 Рё РЅРёР¶Рµ */
+-khtml-opacity: 0.5; /* Konqueror 3.1, Safari 1.1 */
+opacity: 0.5;
+
}
#data_box{position:absolute;top:100px;z-index:1000;width:400px;background:#ffffff;
- -webkit-box-shadow: 0 0 15px #000;
- -moz-box-shadow: 0 0 15px #000;
- box-shadow: 0 0 15px #000;
- border:7px solid #1b9bb6;
- border-radius:5px;
+ -webkit-box-shadow: 0 0 15px #000;
+ -moz-box-shadow: 0 0 15px #000;
+ box-shadow: 0 0 15px #000;
+ border:7px solid #1b9bb6;
+ border-radius:5px;
}
#data_box .data_wrp{padding:25px 15px 15px 15px;}
#data_box .data_wrp h1{text-transform: uppercase;}
@@ -233,10 +229,10 @@ ul.product_colors li img{border:1px solid #d2d2d2;}
.rightbar .control-label{float:left;width:80px;padding-top:5px;}
.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;}
.form-control:focus {
- border:#1b9bb6 1px solid;
- box-shadow: 0 0 10px #1b9bb6;
- -webkit-box-shadow: 0 0 10px #1b9bb6;
- -moz-box-shadow: 0 0 10px #1b9bb6;
+border:#1b9bb6 1px solid;
+box-shadow: 0 0 10px #1b9bb6;
+-webkit-box-shadow: 0 0 10px #1b9bb6;
+-moz-box-shadow: 0 0 10px #1b9bb6;
}
.help-block{color:red;font-size:12px;margin-bottom:5px;}
@@ -341,22 +337,22 @@ ul.social {margin-top: 20px;}
transition: all 0.5s ease-out;
}
.social .fb{background-position:-44px 0;
- cursor: pointer;
+cursor: pointer;
}
.social .vk{
- cursor: pointer;
+cursor: pointer;
}
.social .vk:hover{background-color:#5B7FA6;}
.social .fb:hover{background-color:#354f89;
}
.social .gp{background-position:-132px 0;
- cursor: pointer;}
+cursor: pointer;}
.social .gp:hover{background-color:#c72f21;}
.social .tw{background-position:-144px 0;
- cursor: pointer;}
+cursor: pointer;}
.social .tw:hover{background-color:#6398c9;}
.social .ok{background-position:-89px 0;
- cursor: pointer;}
+cursor: pointer;}
.social .ok:hover{background-color:#f88f15;}
.social ul li a:hover{
background-color:#065baa;
@@ -830,8 +826,8 @@ a.active{font-weight:bold;text-decoration: underline;}
-webkit-font-smoothing: antialiased;
}
.sort_block ul li a.asc:after {
- content: "↓";
+ content: "↑";
}
.sort_block ul li a.desc:after {
- content: "↑";
+ content: "↓";
}
\ No newline at end of file
diff --git a/frontend/web/images/no_photo.png b/frontend/web/images/no_photo.png
new file mode 100644
index 0000000..fc71420
Binary files /dev/null and b/frontend/web/images/no_photo.png differ
diff --git a/frontend/widgets/Rubrics.php b/frontend/widgets/Rubrics.php
new file mode 100644
index 0000000..45383d3
--- /dev/null
+++ b/frontend/widgets/Rubrics.php
@@ -0,0 +1,39 @@
+active)) {
+ $this->active = Yii::$app->request->get('category');
+ }
+ if (!is_object($this->active)) {
+ $this->active = CategorySearch::findByAlias($this->active);
+ }
+ if (!empty($this->active)) {
+ $this->active = $this->active->category_id;
+ }
+ $items = [];
+ foreach (Category::find ()->all () as $category) {
+ $items[] = $category;[
+ 'label' => $category->name ,
+ 'url' => Url::to(['catalog/category', 'category' => $category]),
+ 'active' => !empty($categoryObject) && $categoryObject->alias == $category->alias ? true : false,
+ ];
+ }
+
+ return $this->render('rubrics', ['items' => $items, 'wrapper' => $this->wrapper, 'active' => $this->active]);
+ }
+}
\ No newline at end of file
diff --git a/frontend/widgets/views/rubrics.php b/frontend/widgets/views/rubrics.php
new file mode 100644
index 0000000..546dfde
--- /dev/null
+++ b/frontend/widgets/views/rubrics.php
@@ -0,0 +1,16 @@
+
+
+
+
+
+ = $active?>
+ $category) :?>
+ = \yii\helpers\Html::a($category->name, ['catalog/category', 'category' => $category])?>
+
+
+
+
+
+
\ No newline at end of file
--
libgit2 0.21.4