Skip to content
Snippets Groups Projects
Commit 228ab39d authored by Nadiya Syvokonenko's avatar Nadiya Syvokonenko
Browse files

MAGETWO-47398: Fix L2

parent 473facbf
Branches
No related merge requests found
......@@ -62,10 +62,7 @@ class Configurable extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
$isProductInstance = false;
if ($mainProduct instanceof \Magento\Catalog\Model\Product) {
$mainProductId = $mainProduct->getData(
$this->metadataPool->getMetadata(ProductInterface::class)->getLinkField()
);
$mainProductId = $mainProduct->getId();
$isProductInstance = true;
}
$old = [];
......@@ -91,9 +88,9 @@ class Configurable extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
}
$this->getConnection()->insertMultiple($this->getMainTable(), $data);
}
$linkField = $this->metadataPool->getMetadata(ProductInterface::class)->getLinkField();
// configurable product relations should be added to relation table
$this->_catalogProductRelation->processRelations($mainProductId, $productIds);
$this->_catalogProductRelation->processRelations($mainProduct->getData($linkField), $productIds);
return $this;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment