/** * Perform actions after object load * * @param Mage_Core_Model_Abstract $object * @return Mage_Core_Model_Resource_Db_Abstract */ protected function _afterLoad(Mage_Core_Model_Abstract $object) { parent::_afterLoad($object); if ($this->_urlLoggingCondition->isLogDisabled()) { return $this; } // Add information about quote to visitor $adapter = $this->_getReadAdapter(); $select = $adapter->select()->from($this->getTable('log/quote_table'), 'quote_id')->where('visitor_id = ?', $object->getId())->order('quote_id DESC')->limit(1); $result = $adapter->query($select)->fetch(); if (isset($result['quote_id'])) { $object->setQuoteId((int) $result['quote_id']); } return $this; }
/** * Object initialization */ protected function _construct() { $this->_init('log/visitor'); $userAgent = $this->_httpHelper->getHttpUserAgent(); $ignoreAgents = $this->_config->getNode('global/ignore_user_agents'); if ($ignoreAgents) { $ignoreAgents = $ignoreAgents->asArray(); if (in_array($userAgent, $ignoreAgents)) { $this->_skipRequestLogging = true; } } if ($this->_logCondition->isLogDisabled()) { $this->_skipRequestLogging = true; } }