File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
app/code/Magento/CatalogImportExport/Model/Import Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -2296,7 +2296,8 @@ public function validateRow(array $rowData, $rowNum)
2296
2296
2297
2297
$ sku = $ rowData [self ::COL_SKU ];
2298
2298
2299
- if (isset ($ this ->_oldSku [$ sku ])) {
2299
+ $ isNewProduct = !isset ($ this ->_oldSku [$ sku ]) || (Import::BEHAVIOR_REPLACE == $ this ->getBehavior ());
2300
+ if (!$ isNewProduct ) {
2300
2301
// can we get all necessary data from existent DB product?
2301
2302
// check for supported type of existing product
2302
2303
if (isset ($ this ->_productTypeModels [$ this ->_oldSku [$ sku ]['type_id ' ]])) {
@@ -2346,7 +2347,7 @@ public function validateRow(array $rowData, $rowNum)
2346
2347
$ rowAttributesValid = $ this ->_productTypeModels [$ newSku ['type_id ' ]]->isRowValid (
2347
2348
$ rowData ,
2348
2349
$ rowNum ,
2349
- ! isset ( $ this -> _oldSku [ $ sku ])
2350
+ $ isNewProduct
2350
2351
);
2351
2352
if (!$ rowAttributesValid && self ::SCOPE_DEFAULT == $ rowScope ) {
2352
2353
// mark SCOPE_DEFAULT row as invalid for future child rows if product not in DB already
You can’t perform that action at this time.
0 commit comments