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 |
Definition at line 35 of file Viewed.php.
_getProductsToSkip | ( | ) | [protected] |
Retrieve Product Ids to skip
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
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
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)
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 }
$_eventTypeId = Mage_Reports_Model_Event::EVENT_PRODUCT_VIEW [protected] |
const XML_PATH_RECENTLY_VIEWED_COUNT = 'catalog/recently_products/viewed_count' |
Definition at line 37 of file Viewed.php.