Skip to content

Commit 1969add

Browse files
committed
Correct SendFriend Visibility Check
The existing check would return an error if sending a product with search only visibility.
1 parent f77ac3c commit 1969add

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/code/Magento/SendFriendGraphQl/Model/Provider/GetVisibleProduct.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ public function execute(int $productId): ProductInterface
4949
$product = $this->productRepository->getById($productId);
5050

5151
if (!in_array(
52-
$product->getVisibility(),
53-
$this->visibility->getVisibleInCatalogIds()
52+
(int) $product->getVisibility(),
53+
$this->visibility->getVisibleInSiteIds(),
54+
true
5455
)) {
5556
throw new GraphQlNoSuchEntityException(
5657
__("The product that was requested doesn't exist. Verify the product and try again.")

0 commit comments

Comments
 (0)