Skip to content

Commit 313a8cd

Browse files
committed
ACP2E-3505: Disabled product still appears in related, upsell, crosssell items in grpahQL query
1 parent 9c48c55 commit 313a8cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/Magento/RelatedProductGraphQl/Model/Resolver/Batch/AbstractLikedProducts.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ private function findRelations(array $products, array $loadAttributes, int $link
101101
$relatedProducts = [];
102102
/** @var \Magento\Catalog\Api\Data\ProductInterface $item */
103103
foreach ($relatedSearchResult->getItems() as $item) {
104-
$relatedProducts[$item->getId()] = $item;
104+
if ($item->isAvailable()) {
105+
$relatedProducts[$item->getId()] = $item;
106+
}
105107
}
106108

107109
//Matching products with related products.

0 commit comments

Comments
 (0)