Skip to content

Commit

Permalink
MAGETWO-86044: Fix import grouped products #12853
Browse files Browse the repository at this point in the history
  • Loading branch information
ishakhsuvarov committed Jan 9, 2018
2 parents 1064fe9 + 00a66e5 commit 9c9f2f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -89,7 +89,7 @@ public function saveData()
foreach ($associatedSkusAndQtyPairs as $associatedSkuAndQty) {
++$position;
$associatedSkuAndQty = explode(self::SKU_QTY_DELIMITER, $associatedSkuAndQty);
$associatedSku = isset($associatedSkuAndQty[0]) ? trim($associatedSkuAndQty[0]) : null;
$associatedSku = isset($associatedSkuAndQty[0]) ? strtolower(trim($associatedSkuAndQty[0])) : null;
if (isset($newSku[$associatedSku])) {
$linkedProductId = $newSku[$associatedSku][$this->getProductEntityIdentifierField()];
} elseif (isset($oldSku[$associatedSku])) {
Expand All @@ -99,7 +99,7 @@ public function saveData()
}
$scope = $this->_entityModel->getRowScope($rowData);
if (Product::SCOPE_DEFAULT == $scope) {
$productData = $newSku[$rowData[Product::COL_SKU]];
$productData = $newSku[strtolower($rowData[Product::COL_SKU])];
} else {
$colAttrSet = Product::COL_ATTR_SET;
$rowData[$colAttrSet] = $productData['attr_set_code'];
Expand Down
Expand Up @@ -192,7 +192,7 @@ public function saveDataProvider()
'skus' => [
'newSku' => [
'sku_assoc1' => ['entity_id' => 1],
'productSku' => ['entity_id' => 3, 'attr_set_code' => 'Default', 'type_id' => 'grouped']
'productsku' => ['entity_id' => 3, 'attr_set_code' => 'Default', 'type_id' => 'grouped']
],
'oldSku' => ['sku_assoc2' => ['entity_id' => 2]]
],
Expand All @@ -205,7 +205,7 @@ public function saveDataProvider()
[
'skus' => [
'newSku' => [
'productSku' => ['entity_id' => 1, 'attr_set_code' => 'Default', 'type_id' => 'grouped']
'productsku' => ['entity_id' => 1, 'attr_set_code' => 'Default', 'type_id' => 'grouped']
],
'oldSku' => []
],
Expand Down Expand Up @@ -247,7 +247,7 @@ public function testSaveDataScopeStore()
{
$this->entityModel->expects($this->once())->method('getNewSku')->will($this->returnValue([
'sku_assoc1' => ['entity_id' => 1],
'productSku' => ['entity_id' => 2, 'attr_set_code' => 'Default', 'type_id' => 'grouped']
'productsku' => ['entity_id' => 2, 'attr_set_code' => 'Default', 'type_id' => 'grouped']
]));
$this->entityModel->expects($this->once())->method('getOldSku')->will($this->returnValue([
'sku_assoc2' => ['entity_id' => 3]
Expand Down

0 comments on commit 9c9f2f3

Please sign in to comment.