From 597512107dc6efefc20500e2b5b935eb00085516 Mon Sep 17 00:00:00 2001 From: Yarik Date: Mon, 22 May 2017 15:25:16 +0300 Subject: [PATCH] Import returned back --- common/models/FilterCache.php | 0 common/modules/comment/readme | 0 common/modules/product/models/Export.php | 2 +- common/modules/product/models/Import.php | 48 ++++++++++++++++++++---------------------------- common/modules/product/views/manage/export-process.php | 0 common/modules/product/views/manage/export.php | 0 console/controllers/FilterController.php | 0 console/migrations/m161020_145858_product_variant_add_status.php | 0 console/migrations/m161104_094427_filter_cache.php | 0 console/migrations/m170202_140836_add_description_column_to_brand_table.php | 0 console/migrations/yarik/m170302_170344_add_synonym_and_use_in_menu.php | 0 console/migrations/yarik/m170302_173310_add_category_synonym_column.php | 0 frontend/web/images/new_img/ico-1.png | Bin 132 -> 0 bytes frontend/web/images/new_img/ico/ico-19.png | Bin 1075 -> 0 bytes frontend/web/js/filter.js | 0 frontend/web/sitemap_back.xml | 0 frontend/widgets/FilterList.php | 0 17 files changed, 21 insertions(+), 29 deletions(-) mode change 100644 => 100755 common/models/FilterCache.php mode change 100644 => 100755 common/modules/comment/readme mode change 100644 => 100755 common/modules/product/models/Export.php mode change 100644 => 100755 common/modules/product/views/manage/export-process.php mode change 100644 => 100755 common/modules/product/views/manage/export.php mode change 100644 => 100755 console/controllers/FilterController.php mode change 100644 => 100755 console/migrations/m161020_145858_product_variant_add_status.php mode change 100644 => 100755 console/migrations/m161104_094427_filter_cache.php mode change 100644 => 100755 console/migrations/m170202_140836_add_description_column_to_brand_table.php mode change 100644 => 100755 console/migrations/yarik/m170302_170344_add_synonym_and_use_in_menu.php mode change 100644 => 100755 console/migrations/yarik/m170302_173310_add_category_synonym_column.php mode change 100644 => 100755 frontend/web/images/new_img/ico-1.png mode change 100644 => 100755 frontend/web/images/new_img/ico/ico-19.png mode change 100644 => 100755 frontend/web/js/filter.js mode change 100644 => 100755 frontend/web/sitemap_back.xml mode change 100644 => 100755 frontend/widgets/FilterList.php diff --git a/common/models/FilterCache.php b/common/models/FilterCache.php old mode 100644 new mode 100755 index 81ee210..81ee210 --- a/common/models/FilterCache.php +++ b/common/models/FilterCache.php diff --git a/common/modules/comment/readme b/common/modules/comment/readme old mode 100644 new mode 100755 index 5a40957..5a40957 --- a/common/modules/comment/readme +++ b/common/modules/comment/readme diff --git a/common/modules/product/models/Export.php b/common/modules/product/models/Export.php old mode 100644 new mode 100755 index c07558e..d4050fc --- a/common/modules/product/models/Export.php +++ b/common/modules/product/models/Export.php @@ -114,7 +114,7 @@ $fittersArray = []; foreach($filters as $filter) { if($filter->taxGroup instanceof TaxGroup){ - $fittersArray[ $filter->taxGroup->alias ][] = $filter->value . '(#' . $filter->alias . '#)'; + $fittersArray[ $filter->taxGroup->alias ][] = $filter->value; } } diff --git a/common/modules/product/models/Import.php b/common/modules/product/models/Import.php index 82f6087..20132a2 100755 --- a/common/modules/product/models/Import.php +++ b/common/modules/product/models/Import.php @@ -642,44 +642,36 @@ $filters_options = explode(',', $filter[ 2 ][ 0 ]); foreach ($filters_options as $filter_options) { - $parsed_filter = $this->parseFilter($filter_options); +// $parsed_filter = $this->parseFilter($filter_options); $value = null; - if ($parsed_filter !== false) { +// if ($parsed_filter !== false) { $value = TaxValueString::find() ->innerJoinWith('taxOption') - ->andWhere([ 'tax_option.alias' => $parsed_filter[ 2 ] ]) +// ->andWhere([ 'tax_option.alias' => $parsed_filter[ 2 ] ]) + ->andWhere([ 'value' => $filter_options ]) ->andWhere([ 'tax_option.tax_group_id' => $taxGroup->tax_group_id ]) ->one(); - } +// } if (!$value instanceof TaxValueString) { // Create option $option = new TaxOption(); $option->tax_group_id = $taxGroup->tax_group_id; - if($parsed_filter !== false) { - $option->name = $parsed_filter[1]; - $option->alias = $parsed_filter[2]; - } else { +// if($parsed_filter !== false) { +// $option->name = $parsed_filter[1]; +// $option->alias = $parsed_filter[2]; +// } else { $option->name = $filter_options; - } +// } $option->save(); $value = new TaxValueString(); $value->tax_option_id = $option->tax_option_id; - $value->value = $option->name; + $value->value = $filter_options; $value->save(); $option->default_value = $value->tax_value_id; $option->save(); - } else { - if($parsed_filter !== false) { - $value->value = $parsed_filter[1]; - $value->taxOption->name = $parsed_filter[1]; - } else { - $value->value = $filter_options; - $value->taxOption->name = $filter_options; - } - $value->save(); } $options[] = $value->tax_option_id; @@ -690,13 +682,13 @@ return $options; } - private function parseFilter($filter) - { - $regex = '/^(.+)\(#(.+)#\)$/'; - if (preg_match($regex, $filter, $result)) { - return $result; - } else { - return false; - } - } +// private function parseFilter($filter) +// { +// $regex = '/^(.+)\(#(.+)#\)$/'; +// if (preg_match($regex, $filter, $result)) { +// return $result; +// } else { +// return false; +// } +// } } \ No newline at end of file diff --git a/common/modules/product/views/manage/export-process.php b/common/modules/product/views/manage/export-process.php old mode 100644 new mode 100755 index 48f6372..48f6372 --- a/common/modules/product/views/manage/export-process.php +++ b/common/modules/product/views/manage/export-process.php diff --git a/common/modules/product/views/manage/export.php b/common/modules/product/views/manage/export.php old mode 100644 new mode 100755 index d18b220..d18b220 --- a/common/modules/product/views/manage/export.php +++ b/common/modules/product/views/manage/export.php diff --git a/console/controllers/FilterController.php b/console/controllers/FilterController.php old mode 100644 new mode 100755 index b4998c6..b4998c6 --- a/console/controllers/FilterController.php +++ b/console/controllers/FilterController.php diff --git a/console/migrations/m161020_145858_product_variant_add_status.php b/console/migrations/m161020_145858_product_variant_add_status.php old mode 100644 new mode 100755 index b3f9fac..b3f9fac --- a/console/migrations/m161020_145858_product_variant_add_status.php +++ b/console/migrations/m161020_145858_product_variant_add_status.php diff --git a/console/migrations/m161104_094427_filter_cache.php b/console/migrations/m161104_094427_filter_cache.php old mode 100644 new mode 100755 index 62a6056..62a6056 --- a/console/migrations/m161104_094427_filter_cache.php +++ b/console/migrations/m161104_094427_filter_cache.php diff --git a/console/migrations/m170202_140836_add_description_column_to_brand_table.php b/console/migrations/m170202_140836_add_description_column_to_brand_table.php old mode 100644 new mode 100755 index 803031b..803031b --- a/console/migrations/m170202_140836_add_description_column_to_brand_table.php +++ b/console/migrations/m170202_140836_add_description_column_to_brand_table.php diff --git a/console/migrations/yarik/m170302_170344_add_synonym_and_use_in_menu.php b/console/migrations/yarik/m170302_170344_add_synonym_and_use_in_menu.php old mode 100644 new mode 100755 index ba45b54..ba45b54 --- a/console/migrations/yarik/m170302_170344_add_synonym_and_use_in_menu.php +++ b/console/migrations/yarik/m170302_170344_add_synonym_and_use_in_menu.php diff --git a/console/migrations/yarik/m170302_173310_add_category_synonym_column.php b/console/migrations/yarik/m170302_173310_add_category_synonym_column.php old mode 100644 new mode 100755 index ae83ed9..ae83ed9 --- a/console/migrations/yarik/m170302_173310_add_category_synonym_column.php +++ b/console/migrations/yarik/m170302_173310_add_category_synonym_column.php diff --git a/frontend/web/images/new_img/ico-1.png b/frontend/web/images/new_img/ico-1.png old mode 100644 new mode 100755 index b3b30b3..b3b30b3 Binary files a/frontend/web/images/new_img/ico-1.png and b/frontend/web/images/new_img/ico-1.png differ diff --git a/frontend/web/images/new_img/ico/ico-19.png b/frontend/web/images/new_img/ico/ico-19.png old mode 100644 new mode 100755 index b3a5109..b3a5109 Binary files a/frontend/web/images/new_img/ico/ico-19.png and b/frontend/web/images/new_img/ico/ico-19.png differ diff --git a/frontend/web/js/filter.js b/frontend/web/js/filter.js old mode 100644 new mode 100755 index 7d60a0f..7d60a0f --- a/frontend/web/js/filter.js +++ b/frontend/web/js/filter.js diff --git a/frontend/web/sitemap_back.xml b/frontend/web/sitemap_back.xml old mode 100644 new mode 100755 index 40f0c47..40f0c47 --- a/frontend/web/sitemap_back.xml +++ b/frontend/web/sitemap_back.xml diff --git a/frontend/widgets/FilterList.php b/frontend/widgets/FilterList.php old mode 100644 new mode 100755 index 117dae4..117dae4 --- a/frontend/widgets/FilterList.php +++ b/frontend/widgets/FilterList.php -- libgit2 0.21.4