Skip to content

Commit 6520dab

Browse files
author
Bohdan Korablov
committed
MAGETWO-59743: Product deleted after import with Replace behavior
1 parent 1b719ef commit 6520dab

File tree

1 file changed

+2
-2
lines changed
  • app/code/Magento/CatalogImportExport/Model/Import

1 file changed

+2
-2
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2304,7 +2304,7 @@ public function validateRow(array $rowData, $rowNum)
23042304

23052305
$sku = $rowData[self::COL_SKU];
23062306

2307-
if (isset($this->_oldSku[$sku])) {
2307+
if (isset($this->_oldSku[$sku]) && Import::BEHAVIOR_REPLACE !== $this->getBehavior()) {
23082308
// can we get all necessary data from existent DB product?
23092309
// check for supported type of existing product
23102310
if (isset($this->_productTypeModels[$this->_oldSku[$sku]['type_id']])) {
@@ -2356,7 +2356,7 @@ public function validateRow(array $rowData, $rowNum)
23562356
$rowAttributesValid = $productTypeValidator->isRowValid(
23572357
$rowData,
23582358
$rowNum,
2359-
!isset($this->_oldSku[$sku])
2359+
!(isset($this->_oldSku[$sku]) && Import::BEHAVIOR_REPLACE !== $this->getBehavior())
23602360
);
23612361
if (!$rowAttributesValid && self::SCOPE_DEFAULT == $rowScope) {
23622362
// mark SCOPE_DEFAULT row as invalid for future child rows if product not in DB already

0 commit comments

Comments
 (0)