/**
  * Retrieve url for adding product to conpare list
  *
  * @param   Mage_Catalog_Model_Product $product
  * @return  string
  */
 public function getAddUrl($product)
 {
     if ($this->_logCondition->isVisitorLogEnabled()) {
         return $this->_getUrl('catalog/product_compare/add', $this->_getUrlParams($product));
     }
     return '';
 }
Пример #2
0
 /**
  * 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;
 }
Пример #3
0
 /**
  * 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;
     }
 }
Пример #4
0
 public function toOptionArray()
 {
     $options = array(array('label' => $this->_helper->__('Yes'), 'value' => self::LOG_LEVEL_ALL), array('label' => $this->_helper->__('No'), 'value' => self::LOG_LEVEL_NONE), array('label' => $this->_helper->__('Visitors only'), 'value' => self::LOG_LEVEL_VISITORS));
     return $options;
 }