Public Attributes | |
const | XML_PATH_RECENTLY_COMPARED_COUNT = 'catalog/recently_products/compared_count' |
Protected Member Functions | |
getPageSize () | |
_getProductsToSkip () | |
_hasComparedProductsBefore () | |
_toHtml () | |
Protected Attributes | |
$_eventTypeId = Mage_Reports_Model_Event::EVENT_PRODUCT_COMPARE |
Definition at line 35 of file Compared.php.
_getProductsToSkip | ( | ) | [protected] |
Retrieve Product Ids to skip
Reimplemented from Mage_Reports_Block_Product_Abstract.
Definition at line 59 of file Compared.php.
00060 { 00061 $ids = array(); 00062 if (Mage::helper('catalog/product_compare')->getItemCount()) { 00063 foreach (Mage::helper('catalog/product_compare')->getItemCollection() as $_item) { 00064 $ids[] = $_item->getId(); 00065 } 00066 if (($product = Mage::registry('product')) && $product->getId()) { 00067 $ids[] = $product->getId(); 00068 } 00069 } 00070 return $ids; 00071 }
_hasComparedProductsBefore | ( | ) | [protected] |
Check session has compared products
Definition at line 78 of file Compared.php.
00079 { 00080 return Mage::getSingleton('reports/session')->getData('compared_products'); 00081 }
_toHtml | ( | ) | [protected] |
Prepare to html check has compared products
Reimplemented from Mage_Core_Block_Template.
Definition at line 89 of file Compared.php.
00090 { 00091 if (!$this->_hasComparedProductsBefore()) { 00092 return ''; 00093 } 00094 00095 $collection = $this->_getRecentProductsCollection(); 00096 $hasProducts = (bool)count($collection); 00097 if (is_null($this->_hasComparedProductsBefore())) { 00098 Mage::getSingleton('reports/session')->setData('compared_products', $hasProducts); 00099 } 00100 if ($hasProducts) { 00101 $this->setRecentlyComparedProducts($collection); 00102 } 00103 00104 return parent::_toHtml(); 00105 }
getPageSize | ( | ) | [protected] |
Retrieve page size (count)
Reimplemented from Mage_Reports_Block_Product_Abstract.
Definition at line 46 of file Compared.php.
00047 { 00048 if ($this->hasData('page_size')) { 00049 return $this->getData('page_size'); 00050 } 00051 return Mage::getStoreConfig(self::XML_PATH_RECENTLY_COMPARED_COUNT); 00052 }
$_eventTypeId = Mage_Reports_Model_Event::EVENT_PRODUCT_COMPARE [protected] |
const XML_PATH_RECENTLY_COMPARED_COUNT = 'catalog/recently_products/compared_count' |
Definition at line 37 of file Compared.php.