Skip to content

Commit f20a33d

Browse files
Merge branch 'MAGNIMEX-195-' into 'master'
Magnimex 195 See merge request !152
2 parents 1be8ffc + 3273a94 commit f20a33d

File tree

2 files changed

+23
-0
lines changed
  • app/code/Magento

2 files changed

+23
-0
lines changed

app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ protected function parseOption($values)
238238
protected function populateOptionTemplate($option, $entityId, $index = null)
239239
{
240240
$populatedOption = [
241+
'option_id' => null,
241242
'parent_id' => $entityId,
242243
'required' => isset($option['required']) ? $option['required'] : 1,
243244
'position' => ($index === null ? 0 : $index),

app/code/Magento/ConfigurableImportExport/Model/Import/Product/Type/Configurable.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,10 @@ public function saveData()
817817
}
818818

819819
while ($bunch = $this->_entityModel->getNextBunch()) {
820+
if (!$this->configurableInBunch($bunch)) {
821+
continue;
822+
}
823+
820824
$this->_superAttributesData = [
821825
'attributes' => [],
822826
'labels' => [],
@@ -860,6 +864,24 @@ public function saveData()
860864
return $this;
861865
}
862866

867+
/**
868+
* @param $bunch
869+
* @return bool
870+
*/
871+
protected function configurableInBunch($bunch)
872+
{
873+
$newSku = $this->_entityModel->getNewSku();
874+
foreach ($bunch as $rowNum => $rowData) {
875+
$productData = $newSku[$rowData[\Magento\CatalogImportExport\Model\Import\Product::COL_SKU]];
876+
if (($this->_type == $productData['type_id']) &&
877+
($rowData == $this->_entityModel->isRowAllowedToImport($rowData, $rowNum))
878+
) {
879+
return true;
880+
}
881+
}
882+
return false;
883+
}
884+
863885
/**
864886
* Validate row attributes. Pass VALID row data ONLY as argument.
865887
*

0 commit comments

Comments
 (0)