Skip to content

Commit d95ffa1

Browse files
author
Michail Slabko
committed
MAGETWO-46826: Multistore: Import product with Replace behaviour causes an error "URL key for specified store already exists."
1 parent 25cf0c3 commit d95ffa1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/code/Magento/CatalogUrlRewrite/Observer/AfterImportDataObserver.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ public function execute(Observer $observer)
157157
protected function _populateForUrlGeneration($rowData)
158158
{
159159
$newSku = $this->import->getNewSku($rowData[ImportProduct::COL_SKU]);
160-
if (empty($newSku) || !isset($newSku['entity_id']) || empty($rowData[self::URL_KEY_ATTRIBUTE_CODE])) {
160+
if (empty($newSku) || !isset($newSku['entity_id'])) {
161+
return null;
162+
}
163+
if ($this->import->getRowScope($rowData) == ImportProduct::SCOPE_STORE
164+
&& empty($rowData[self::URL_KEY_ATTRIBUTE_CODE])) {
161165
return null;
162166
}
163167
$rowData['entity_id'] = $newSku['entity_id'];

0 commit comments

Comments
 (0)