$combinations =
$this->configurationLoader->
getCombinations($productIds);
$listingPrices =
$this->listingVariationLoader->
getListingPrices($shop,
$products,
$variantConfiguration,
$variantFacet);
$availability =
$this->listingVariationLoader->
getAvailability($products,
$variantConfiguration,
$variantFacet);
} $manualPositions =
$this->manualPositionLoader->
get($productIds);
$result =
[];
foreach ($products as $listProduct) { $product = Product::
createFromListProduct($listProduct);
$number =
$product->
getNumber();
$id =
$product->
getId();
$product->
setHasStock($product->
getStock() >=
$product->
getUnit()->
getMinPurchase());
if ($variantFacet &&
$variantConfiguration) { $this->
addVariantSearchDetails($product,
$configurations,
$variantFacet,
$variantConfiguration,
$combinations,
$listingPrices,
$availability);
} elseif (!
$product->
isMainVariant()) { continue;
} elseif (!
$listProduct->
isAvailable()) { $product->
setHasAvailableVariant(false
);
}