Mage_Reports_Block_Product_Viewed Class Reference

Inheritance diagram for Mage_Reports_Block_Product_Viewed:

Mage_Reports_Block_Product_Abstract Mage_Catalog_Block_Product_Abstract Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Attributes

const XML_PATH_RECENTLY_VIEWED_COUNT = 'catalog/recently_products/viewed_count'

Protected Member Functions

 getPageSize ()
 _getProductsToSkip ()
 _hasViewedProductsBefore ()
 _toHtml ()

Protected Attributes

 $_eventTypeId = Mage_Reports_Model_Event::EVENT_PRODUCT_VIEW


Detailed Description

Definition at line 35 of file Viewed.php.


Member Function Documentation

_getProductsToSkip (  )  [protected]

Retrieve Product Ids to skip

Returns:
array

Reimplemented from Mage_Reports_Block_Product_Abstract.

Definition at line 59 of file Viewed.php.

00060     {
00061         $ids = array();
00062         if (($product = Mage::registry('product')) && $product->getId()) {
00063             $ids = (int)$product->getId();
00064         }
00065         return $ids;
00066     }

_hasViewedProductsBefore (  )  [protected]

Check session has viewed products

Returns:
bool

Definition at line 73 of file Viewed.php.

00074     {
00075         return Mage::getSingleton('reports/session')->getData('viewed_products');
00076     }

_toHtml (  )  [protected]

Prepare to html check has viewed products

Returns:
string

Reimplemented from Mage_Core_Block_Template.

Definition at line 84 of file Viewed.php.

00085     {
00086         if (!$this->_hasViewedProductsBefore()) {
00087             return '';
00088         }
00089 
00090         $collection = $this->_getRecentProductsCollection();
00091         $hasProducts = (bool)count($collection);
00092         if (is_null($this->_hasViewedProductsBefore())) {
00093             Mage::getSingleton('reports/session')->setData('viewed_products', $hasProducts);
00094         }
00095         if ($hasProducts) {
00096             $this->setRecentlyViewedProducts($collection);
00097         }
00098 
00099         return parent::_toHtml();
00100     }

getPageSize (  )  [protected]

Retrieve page size (count)

Returns:
int

Reimplemented from Mage_Reports_Block_Product_Abstract.

Definition at line 46 of file Viewed.php.

00047     {
00048         if ($this->hasData('page_size')) {
00049             return $this->getData('page_size');
00050         }
00051         return Mage::getStoreConfig(self::XML_PATH_RECENTLY_VIEWED_COUNT);
00052     }


Member Data Documentation

$_eventTypeId = Mage_Reports_Model_Event::EVENT_PRODUCT_VIEW [protected]

Reimplemented from Mage_Reports_Block_Product_Abstract.

Definition at line 39 of file Viewed.php.

const XML_PATH_RECENTLY_VIEWED_COUNT = 'catalog/recently_products/viewed_count'

Definition at line 37 of file Viewed.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:36 2009 for Magento by  doxygen 1.5.8