/**
  * Get the products to display for table.
  *
  * @return array
  */
 public function getLoadedProductCollection()
 {
     //products to be diplayd for recommended pages
     $productsToDisplay = [];
     $productsToDisplayCounter = 0;
     $quoteId = $this->getRequest()->getParam('quote_id');
     //display mode based on the action name
     $mode = $this->getRequest()->getActionName();
     $quoteModel = $this->quoteFactory->create()->load($quoteId);
     //number of product items to be displayed
     $limit = $this->recommendedHelper->getDisplayLimitByMode($mode);
     $quoteItems = $quoteModel->getAllItems();
     $numItems = count($quoteItems);
     //no product found to display
     if ($numItems == 0 || !$limit) {
         return [];
     } elseif ($numItems > $limit) {
         $maxPerChild = 1;
     } else {
         $maxPerChild = number_format($limit / $numItems);
     }
     $this->helper->log('DYNAMIC QUOTE PRODUCTS : limit ' . $limit . ' products : ' . $numItems . ', max per child : ' . $maxPerChild);
     foreach ($quoteItems as $item) {
         $i = 0;
         //parent product
         $productModel = $item->getProduct();
         //check for product exists
         if ($productModel->getId()) {
             //get single product for current mode
             $recommendedProducts = $this->_getRecommendedProduct($productModel, $mode);
             foreach ($recommendedProducts as $product) {
                 //check if still exists
                 if ($product->getId() && $productsToDisplayCounter < $limit && $i <= $maxPerChild && $product->isSaleable() && !$product->getParentId()) {
                     //we have a product to display
                     $productsToDisplay[$product->getId()] = $product;
                     $i++;
                     $productsToDisplayCounter++;
                 }
             }
         }
         //have reached the limit don't loop for more
         if ($productsToDisplayCounter == $limit) {
             break;
         }
     }
     //check for more space to fill up the table with fallback products
     if ($productsToDisplayCounter < $limit) {
         $fallbackIds = $this->recommendedHelper->getFallbackIds();
         $productCollection = $this->productFactory->create()->getCollection()->addIdFilter($fallbackIds)->addAttributeToSelect(['product_url', 'name', 'store_id', 'small_image', 'price']);
         foreach ($productCollection as $product) {
             if ($product->isSaleable()) {
                 $productsToDisplay[$product->getId()] = $product;
             }
             //stop the limit was reached
             //@codingStandardsIgnoreStart
             if (count($productsToDisplay) == $limit) {
                 break;
             }
             //@codingStandardsIgnoreEnd
         }
     }
     $this->helper->log('quote - loaded product to display ' . count($productsToDisplay));
     return $productsToDisplay;
 }