Skip to content

Commit 27e02f8

Browse files
committed
MAGETWO-53305: [Staging] When update was applied Cross-Sells data are not displayed in the shopping cart
1 parent aac4f42 commit 27e02f8

File tree

1 file changed

+5
-3
lines changed
  • app/code/Magento/Catalog/Model/ResourceModel/Product/Link/Product

1 file changed

+5
-3
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Link/Product/Collection.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function addProductFilter($products)
220220
$products = [$products];
221221
}
222222
$identifierField = $this->getMetadataPool()->getMetadata(ProductInterface::class)->getIdentifierField();
223-
$this->getSelect()->where("cpe.$identifierField IN (?)", $products);
223+
$this->getSelect()->where("product_entity_table.$identifierField IN (?)", $products);
224224
$this->_hasLinkFilter = true;
225225
}
226226

@@ -442,9 +442,11 @@ private function getMetadataPool()
442442
private function joinProductsToLinks()
443443
{
444444
if ($this->_hasLinkFilter) {
445-
$linkField = $this->getMetadataPool()->getMetadata(ProductInterface::class)->getLinkField();
445+
$metaDataPool = $this->getMetadataPool()->getMetadata(ProductInterface::class);
446+
$linkField = $metaDataPool->getLinkField();
447+
$entityTable = $metaDataPool->getEntityTable();
446448
$this->getSelect()
447-
->join(['cpe' => $this->getMainTable()], "links.product_id = cpe.$linkField", []);
449+
->join(['product_entity_table' => $entityTable], "links.product_id = product_entity_table.$linkField", []);
448450
}
449451
}
450452
}

0 commit comments

Comments
 (0)