Skip to content

Commit 9c9f2f3

Browse files
MAGETWO-86044: Fix import grouped products #12853
2 parents 1064fe9 + 00a66e5 commit 9c9f2f3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/code/Magento/GroupedImportExport/Model/Import/Product/Type/Grouped.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function saveData()
8989
foreach ($associatedSkusAndQtyPairs as $associatedSkuAndQty) {
9090
++$position;
9191
$associatedSkuAndQty = explode(self::SKU_QTY_DELIMITER, $associatedSkuAndQty);
92-
$associatedSku = isset($associatedSkuAndQty[0]) ? trim($associatedSkuAndQty[0]) : null;
92+
$associatedSku = isset($associatedSkuAndQty[0]) ? strtolower(trim($associatedSkuAndQty[0])) : null;
9393
if (isset($newSku[$associatedSku])) {
9494
$linkedProductId = $newSku[$associatedSku][$this->getProductEntityIdentifierField()];
9595
} elseif (isset($oldSku[$associatedSku])) {
@@ -99,7 +99,7 @@ public function saveData()
9999
}
100100
$scope = $this->_entityModel->getRowScope($rowData);
101101
if (Product::SCOPE_DEFAULT == $scope) {
102-
$productData = $newSku[$rowData[Product::COL_SKU]];
102+
$productData = $newSku[strtolower($rowData[Product::COL_SKU])];
103103
} else {
104104
$colAttrSet = Product::COL_ATTR_SET;
105105
$rowData[$colAttrSet] = $productData['attr_set_code'];

app/code/Magento/GroupedImportExport/Test/Unit/Model/Import/Product/Type/GroupedTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function saveDataProvider()
192192
'skus' => [
193193
'newSku' => [
194194
'sku_assoc1' => ['entity_id' => 1],
195-
'productSku' => ['entity_id' => 3, 'attr_set_code' => 'Default', 'type_id' => 'grouped']
195+
'productsku' => ['entity_id' => 3, 'attr_set_code' => 'Default', 'type_id' => 'grouped']
196196
],
197197
'oldSku' => ['sku_assoc2' => ['entity_id' => 2]]
198198
],
@@ -205,7 +205,7 @@ public function saveDataProvider()
205205
[
206206
'skus' => [
207207
'newSku' => [
208-
'productSku' => ['entity_id' => 1, 'attr_set_code' => 'Default', 'type_id' => 'grouped']
208+
'productsku' => ['entity_id' => 1, 'attr_set_code' => 'Default', 'type_id' => 'grouped']
209209
],
210210
'oldSku' => []
211211
],
@@ -247,7 +247,7 @@ public function testSaveDataScopeStore()
247247
{
248248
$this->entityModel->expects($this->once())->method('getNewSku')->will($this->returnValue([
249249
'sku_assoc1' => ['entity_id' => 1],
250-
'productSku' => ['entity_id' => 2, 'attr_set_code' => 'Default', 'type_id' => 'grouped']
250+
'productsku' => ['entity_id' => 2, 'attr_set_code' => 'Default', 'type_id' => 'grouped']
251251
]));
252252
$this->entityModel->expects($this->once())->method('getOldSku')->will($this->returnValue([
253253
'sku_assoc2' => ['entity_id' => 3]

0 commit comments

Comments
 (0)