I have explained the method for displaying random products below:
<?php //below code to written in file which extends the product block $collection = Mage::getResourceModel('catalog/product_collection'); Mage::getModel('catalog/layer')->prepareProductCollection($collection); $collection->getSelect()->order('rand()'); $collection->addStoreFilter(); $this->setProductCollection($collection); return parent::_beforeToHtml(); ?>
//below code to written in template file if (($_products = $this->getProductCollection())): echo $_product->getSku(); endif;
You can extend the script further as per your requirement. This is a basic way of displaying random products in a page from the product catalog.
Hope it is helpful