From 08e62d82937d21285b697c62940e02ec21c5ad5c Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 16 Sep 2016 17:44:28 +0300 Subject: [PATCH] big commti --- common/modules/product/models/Import.php | 6 +++--- common/modules/product/widgets/views/product_smart.php | 13 +++++++++++-- common/modules/product/widgets/views/products_block.php | 5 ++++- frontend/views/layouts/main.php | 91 ++----------------------------------------------------------------------------------------- frontend/views/search/index.php | 222 +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- frontend/widgets/views/_filter_view.php | 8 +++----- 6 files changed, 24 insertions(+), 321 deletions(-) diff --git a/common/modules/product/models/Import.php b/common/modules/product/models/Import.php index d7fea3d..c38ab00 100755 --- a/common/modules/product/models/Import.php +++ b/common/modules/product/models/Import.php @@ -313,7 +313,7 @@ class Import extends Model { foreach($catalog_names as $catalog_name){ // ==== Set category ==== - if ( ($category = CategoryName::find()->filterWhere(['ilike', 'value', trim($catalog_name)])->one()) === null ) { + if ( ($category = Category::find()->filterWhere(['ilike', 'name', trim($catalog_name)])->one()) === null ) { // Create category $category = new Category(); $category->name = trim($catalog_name); @@ -328,7 +328,7 @@ class Import extends Model { // ===== Set brand ==== if ( $brand_name ) { - if ( ($brand = BrandName::find()->filterWhere(['ilike', 'value', trim($brand_name)])->one()) !== null ) { + if ( ($brand = Brand::find()->filterWhere(['ilike', 'name', trim($brand_name)])->one()) !== null ) { $_product->brand_id = $brand->brand_id; } else { // Create brand @@ -557,7 +557,7 @@ class Import extends Model { $taxGroup->name = $filter_name; $taxGroup->module = 'string'; $taxGroup->hierarchical = FALSE; - $taxGroup->group_to_category = $catalog_names; + $taxGroup->categories = $catalog_names; $taxGroup->is_filter = FALSE; $taxGroup->save(); } diff --git a/common/modules/product/widgets/views/product_smart.php b/common/modules/product/widgets/views/product_smart.php index 906cbba..47095d9 100755 --- a/common/modules/product/widgets/views/product_smart.php +++ b/common/modules/product/widgets/views/product_smart.php @@ -7,8 +7,17 @@ use yii\helpers\Url; ?>
-
-
+
+
'; + } else if($class == 'new') { + print '
'; + } else if($class == 'promo'){ + print '
'; + } + ?> +
diff --git a/common/modules/product/widgets/views/products_block.php b/common/modules/product/widgets/views/products_block.php index 865159b..0652a2e 100755 --- a/common/modules/product/widgets/views/products_block.php +++ b/common/modules/product/widgets/views/products_block.php @@ -13,7 +13,10 @@ use yii\web\View;
- render('product_smart', ['product' => $product]);?> + render('product_smart', [ + 'product' => $product, + 'class' => $class + ]);?>
diff --git a/frontend/views/layouts/main.php b/frontend/views/layouts/main.php index e471ccb..5251139 100755 --- a/frontend/views/layouts/main.php +++ b/frontend/views/layouts/main.php @@ -528,54 +528,7 @@ use common\models\Basket;
- +