Skip to content

Commit

Permalink
Do not process linkTypes that were already processed in plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
kassner committed May 26, 2017
1 parent 8491be6 commit f3a855c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ protected function setProductLinks(\Magento\Catalog\Model\Product $product)
$linkTypes[$linkTypeObject->getName()] = $product->getData($linkTypeObject->getName() . '_readonly');
}

// skip linkTypes that were already processed on initializeLinks plugins
foreach ($productLinks as $productLink) {
unset($linkTypes[$productLink->getLinkType()]);
}

foreach ($linkTypes as $linkType => $readonly) {
if (isset($links[$linkType]) && !$readonly) {
foreach ((array)$links[$linkType] as $linkData) {
Expand Down

0 comments on commit f3a855c

Please sign in to comment.