if ($searchResult === null
) { return;
} /** @var SalesChannelProductEntity|null $product */
$product =
$searchResult->
get($productId);
if ($product === null
) { return;
} if ($this->systemConfigService->
get('core.listing.hideCloseoutProductsWhenOutOfStock',
$salesChannelContext->
getSalesChannel()->
getId()) &&
$product->
getIsCloseout() &&
$product->
getAvailableStock() <= 0
) { return;
} $productBox->
setProduct($product);
$productBox->
setProductId($product->
getId());
}}