/**
  * Load entities records into items
  *
  * Removed page limiting SQL from this method to prevent issues with paging and Klevu.
  *
  * @throws Exception
  * @return Mage_Eav_Model_Entity_Collection_Abstract
  */
 public function _loadEntities($printQuery = false, $logQuery = false)
 {
     if (!$this->isExtensionConfigured()) {
         return parent::_loadEntities($printQuery, $logQuery);
     }
     // API results are already filtered, so include only the products
     // returned by the API in the collection
     $this->getSelect()->reset(Zend_Db_Select::WHERE);
     $this->addFieldToFilter('entity_id', array('in' => $this->_getProductIds()));
     // API results are ordered using the selected sort order, so enforce
     // the collection order to match the API results
     $this->getSelect()->reset(Zend_Db_Select::ORDER);
     $this->getSelect()->reset(Zend_Db_Select::LIMIT_OFFSET);
     if (count($this->_getProductIds())) {
         // Use "FIELD (column, 1[,2,3,4]) ASC" for ordering, where "1[,2,3,4]" is the list of IDs in the order required
         $this->getSelect()->order(sprintf('FIELD(`e`.`entity_id`, %s) ASC', implode(',', $this->_getProductIds())));
     }
     $this->printLogQuery($printQuery, $logQuery);
     try {
         /**
          * Prepare select query
          * @var string $query
          */
         if (is_callable(array($this, "_prepareSelect"))) {
             $query = $this->_prepareSelect($this->getSelect());
         } else {
             $query = $this->getSelect();
         }
         $rows = $this->_fetchAll($query);
     } catch (Exception $e) {
         Mage::printException($e, $query);
         $this->printLogQuery(true, true, $query);
         throw $e;
     }
     foreach ($rows as $v) {
         $object = $this->getNewEmptyItem()->setData($v);
         $this->addItem($object);
         if (isset($this->_itemsById[$object->getId()])) {
             $this->_itemsById[$object->getId()][] = $object;
         } else {
             $this->_itemsById[$object->getId()] = array($object);
         }
     }
     return $this;
 }