diff --git a/app/assets/javascripts/admin/product_import/controllers/import_options_form.js.coffee b/app/assets/javascripts/admin/product_import/controllers/import_options_form.js.coffee index 2198b830dc..965692c86d 100644 --- a/app/assets/javascripts/admin/product_import/controllers/import_options_form.js.coffee +++ b/app/assets/javascripts/admin/product_import/controllers/import_options_form.js.coffee @@ -27,12 +27,11 @@ angular.module("admin.productImport").controller "ImportOptionsFormCtrl", ($scop $scope.toggleResetAbsent = (id) -> checked = $scope.settings[id]['reset_all_absent'] - confirmed = confirm t('js.product_import.confirmation') if resetAbsent + confirmed = confirm t('js.product_import.confirmation') if checked if confirmed or !checked - ProductImportService.updateResetAbsent($scope.supplierId, $scope.reset_counts[$scope.supplierId], resetAbsent) - - if !confirmed and checked + ProductImportService.updateResetAbsent($scope.supplierId, $scope.reset_counts[$scope.supplierId], checked) + else $scope.settings[id]['reset_all_absent'] = false $scope.resetTotal = ProductImportService.resetTotal diff --git a/app/controllers/admin/product_import_controller.rb b/app/controllers/admin/product_import_controller.rb index b8c760a9fc..4037bcd85b 100644 --- a/app/controllers/admin/product_import_controller.rb +++ b/app/controllers/admin/product_import_controller.rb @@ -5,7 +5,7 @@ module Admin before_filter :validate_upload_presence, except: %i[index guide validate_data] def guide - @product_categories = Spree::Taxon.order('name ASC').pluck(:name) + @product_categories = Spree::Taxon.order('name ASC').pluck(:name).uniq @tax_categories = Spree::TaxCategory.order('name ASC').pluck(:name) @shipping_categories = Spree::ShippingCategory.order('name ASC').pluck(:name) end