Protected Member Functions | |
getPageSize () | |
_getProductsToSkip () | |
_getRecentProductsCollection () | |
Protected Attributes | |
$_eventTypeId = 0 |
Definition at line 27 of file Abstract.php.
_getProductsToSkip | ( | ) | [protected] |
Obtain product ids, that must not be included in collection
Reimplemented in Mage_Reports_Block_Product_Compared, and Mage_Reports_Block_Product_Viewed.
Definition at line 48 of file Abstract.php.
00049 { 00050 return array(); 00051 }
_getRecentProductsCollection | ( | ) | [protected] |
Get products collection and apply recent events log to it
Definition at line 58 of file Abstract.php.
00059 { 00060 // get products collection and apply status and visibility filter 00061 $collection = $this->_addProductAttributesAndPrices(Mage::getModel('catalog/product')->getCollection()) 00062 ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes()) 00063 ->addUrlRewrite() 00064 ->setPageSize($this->getPageSize()) 00065 ->setCurPage(1) 00066 ; 00067 Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection); 00068 Mage::getSingleton('catalog/product_visibility')->addVisibleInSiteFilterToCollection($collection); 00069 00070 // apply events log to collection with required parameters 00071 $skip = $this->_getProductsToSkip(); 00072 $subtype = 0; 00073 if (Mage::getSingleton('customer/session')->isLoggedIn()) { 00074 $subjectId = Mage::getSingleton('customer/session')->getCustomer()->getId(); 00075 } else { 00076 $subjectId = Mage::getSingleton('log/visitor')->getId(); 00077 $subtype = 1; 00078 } 00079 Mage::getResourceSingleton('reports/event')->applyLogToCollection($collection, $this->_eventTypeId, $subjectId, $subtype, $skip); 00080 00081 foreach ($collection as $product) { 00082 $product->setDoNotUseCategoryId(true); 00083 } 00084 return $collection; 00085 }
getPageSize | ( | ) | [protected] |
Retrieve page size (count)
Reimplemented in Mage_Reports_Block_Product_Compared, and Mage_Reports_Block_Product_Viewed.
Definition at line 36 of file Abstract.php.
00037 { 00038 if ($this->hasData('page_size')) { 00039 return $this->getData('page_size'); 00040 } 00041 return 5; 00042 }
$_eventTypeId = 0 [protected] |
Reimplemented in Mage_Reports_Block_Product_Compared, and Mage_Reports_Block_Product_Viewed.
Definition at line 29 of file Abstract.php.