Skip to content

Commit

Permalink
Merge pull request #42 from ho-nl/TEN-661
Browse files Browse the repository at this point in the history
Ten 661
  • Loading branch information
Maikel-Koek authored Aug 30, 2023
2 parents 4a6e731 + 5de15c3 commit ea2396e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Rewrite/ImportExport/Import/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ protected function _saveProducts()

$rowData = $productTypeModel->prepareAttributesWithDefaultValueForSave(
$rowData,
!isset($this->_oldSku[$rowSku])
!isset($this->_oldSku[strtolower($rowSku)])
);
$product = $this->_proxyProdFactory->create(['data' => $rowData]);

Expand Down Expand Up @@ -551,7 +551,7 @@ protected function _saveProducts()
} elseif (self::SCOPE_STORE == $attribute->getIsGlobal()) {
$storeIds = [$rowStore];
}
if (!isset($this->_oldSku[$rowSku])) {
if (!isset($this->_oldSku[strtolower($rowSku)])) {
$storeIds[] = 0;
}
}
Expand Down Expand Up @@ -597,7 +597,7 @@ protected function _saveProducts()

public function skipUpdatingAttribute($rowSku, $attrCode)
{
return isset($this->_oldSku[$rowSku]) && \array_key_exists(self::SKIP_ATTRIBUTES_WHEN_UPDATING, $this->_parameters) && \array_key_exists($attrCode, $this->_parameters[self::SKIP_ATTRIBUTES_WHEN_UPDATING]);
return isset($this->_oldSku[strtolower($rowSku)]) && \array_key_exists(self::SKIP_ATTRIBUTES_WHEN_UPDATING, $this->_parameters) && \array_key_exists($attrCode, $this->_parameters[self::SKIP_ATTRIBUTES_WHEN_UPDATING]);
}

/**
Expand Down Expand Up @@ -637,7 +637,7 @@ public function validateRow(array $rowData, $rowNum)
$rowScope = $this->getRowScope($rowData);
// BEHAVIOR_DELETE use specific validation logic
if (Import::BEHAVIOR_DELETE == $this->getBehavior()) {
if (self::SCOPE_DEFAULT == $rowScope && !isset($this->_oldSku[$rowData[self::COL_SKU]])) {
if (self::SCOPE_DEFAULT == $rowScope && !isset($this->_oldSku[strtolower($rowData[self::COL_SKU])])) {
$this->addRowError(ValidatorInterface::ERROR_SKU_NOT_FOUND_FOR_DELETE, $rowNum);
return false;
}
Expand Down

0 comments on commit ea2396e

Please sign in to comment.