Exemple #1
0
 /**
  * Actions after save
  *
  * @param Mage_Core_Model_Abstract $visitor
  * @return Mage_Log_Model_Resource_Visitor
  */
 protected function _afterSave(Mage_Core_Model_Abstract $visitor)
 {
     if ($this->_urlLoggingCondition->isLogDisabled()) {
         return $this;
     }
     if ($visitor->getIsNewVisitor()) {
         if ($this->_urlLoggingCondition->isLogEnabled()) {
             $this->_saveVisitorInfo($visitor);
             $visitor->setIsNewVisitor(false);
         }
     } else {
         if ($this->_urlLoggingCondition->isLogEnabled()) {
             $this->_saveVisitorUrl($visitor);
             if ($visitor->getDoCustomerLogin() || $visitor->getDoCustomerLogout()) {
                 $this->_saveCustomerInfo($visitor);
             }
         }
         if ($this->_urlLoggingCondition->isVisitorLogEnabled()) {
             if ($visitor->getDoQuoteCreate() || $visitor->getDoQuoteDestroy()) {
                 $this->_saveQuoteInfo($visitor);
             }
         }
     }
     return $this;
 }
 /**
  * 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 '';
 }