public function prepareResult($object, $queryText, $query) { if (!$this->config->getApplicationID() || !$this->config->getAPIKey() || $this->config->isEnabledFrontEnd() === false) { return parent::prepareResult($object, $queryText, $query); } return $this; }
/** * Call algoliasearch.xml To load js / css / phtml. */ public function useAlgoliaSearchPopup(Varien_Event_Observer $observer) { if ($this->config->isEnabledFrontEnd()) { if ($this->config->getApplicationID() && $this->config->getAPIKey()) { if ($this->config->isPopupEnabled() || $this->config->isInstantEnabled()) { $observer->getLayout()->getUpdate()->addHandle('algolia_search_handle'); if ($this->config->isDefaultSelector()) { $observer->getLayout()->getUpdate()->addHandle('algolia_search_handle_with_topsearch'); } else { $observer->getLayout()->getUpdate()->addHandle('algolia_search_handle_no_topsearch'); } } } } return $this; }