Protected Member Functions | |
_getProductCollection () |
Definition at line 35 of file Random.php.
_getProductCollection | ( | ) | [protected] |
Retrieve loaded category collection
Reimplemented from Mage_Catalog_Block_Product_List.
Definition at line 37 of file Random.php.
00038 { 00039 if (is_null($this->_productCollection)) { 00040 $collection = Mage::getResourceModel('catalog/product_collection'); 00041 Mage::getModel('catalog/layer')->prepareProductCollection($collection); 00042 $collection->getSelect()->order('rand()'); 00043 $collection->addStoreFilter(); 00044 $numProducts = $this->getNumProducts() ? $this->getNumProducts() : 3; 00045 $collection->setPage(1, $numProducts); 00046 00047 $this->_productCollection = $collection; 00048 } 00049 return $this->_productCollection; 00050 }