public function clearAction()
 {
     if ($this->_isEnabled()) {
         $message = '';
         $items = Mage::getResourceModel('catalog/product_compare_item_collection');
         if (Mage::getSingleton('customer/session')->isLoggedIn()) {
             $items->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId());
         } elseif ($this->_customerId) {
             $items->setCustomerId($this->_customerId);
         } else {
             $items->setVisitorId(Mage::getSingleton('log/visitor')->getId());
         }
         try {
             $items->clear();
             $message = 'The comparison list was cleared.';
             Mage::helper('catalog/product_compare')->calculate();
         } catch (Mage_Core_Exception $e) {
             $message = $e->getMessage();
         } catch (Exception $e) {
             $message = $this->__('An error occurred while clearing comparison list.');
         }
         $this->setResponse($message);
     } else {
         parent::clearAction();
     }
 }