Block/Recommended/Wishlistproducts.php
private function fillProductsToDisplay($productsToDisplay, &$productsToDisplayCounter, $limit)
    {
        $fallbackIds = $this->recommnededHelper->getFallbackIds();
        $productCollection = $this->catalog->getProductCollectionFromIds($fallbackIds);

        foreach ($productCollection as $product) {
            if ($product->isSaleable()) {
                $productsToDisplay[$product->getId()] = $product;
                $productsToDisplayCounter++;
            }

            //stop the limit was reached
            if ($productsToDisplayCounter == $limit) {
                break;
            }
        }
        return $productsToDisplay;
    }
private function fillProductsToDisplay($productsToDisplay, &$productsToDisplayCounter, $limit)
    {
        $fallbackIds = $this->recommnededHelper->getFallbackIds();
        $productCollection = $this->catalog->getProductCollectionFromIds($fallbackIds);

        foreach ($productCollection as $product) {
            if ($product->isSaleable()) {
                $productsToDisplay[$product->getId()] = $product;
                $productsToDisplayCounter++;
            }

            //stop the limit was reached
            if ($productsToDisplayCounter == $limit) {
                break;
            }
        }
        return $productsToDisplay;
    }
private function fillProductsToDisplay ( $ productsToDisplay , & $ productsToDisplayCounter , $ limit ) { $ fallbackIds = $ this -> recommnededHelper -> getFallbackIds ( ) ; $ productCollection = $ this -> catalog -> getProductCollectionFromIds ( $ fallbackIds ) ; foreach ( $ productCollection as $ product ) { if ( $ product -> isSaleable ( ) ) { $ productsToDisplay [ $ product -> getId ( ) ] = $ product ; $ productsToDisplayCounter ++ ; } //stop the limit was reached if ( $ productsToDisplayCounter == $ limit ) { break ; } } return $ productsToDisplay ; }
Fill products to display

@param array $productsToDisplay
@param int $productsToDisplayCounter
@param int $limit

@return array
Fill products to display