diff --git a/app/models/product_import/entry_validator.rb b/app/models/product_import/entry_validator.rb index 50d8879d77..915e78b6f6 100644 --- a/app/models/product_import/entry_validator.rb +++ b/app/models/product_import/entry_validator.rb @@ -40,6 +40,7 @@ module ProductImport category_validation(entry) tax_and_shipping_validation(entry, 'tax', entry.tax_category, @spreadsheet_data.tax_index) tax_and_shipping_validation(entry, 'shipping', entry.shipping_category, @spreadsheet_data.shipping_index) + shipping_presence_validation(entry) product_validation(entry) end end @@ -233,6 +234,10 @@ module ProductImport end end + def shipping_presence_validation(entry) + mark_as_invalid(entry, attribute: "shipping_category", error: I18n.t(:error_required)) unless entry.shipping_category_id + end + def product_validation(entry) products = Spree::Product.where(supplier_id: entry.enterprise_id, name: entry.name,