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;

?>

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *