I\'d like to get a list of random products from the same category as the current product for displaying within the product view - so far all I\'ve dug up is
Magento
This code will helps you to get products from category id 2. And also here uses a template file list_home.phtml for the product listing.
echo $this->getLayout()->createBlock("catalog/product_list")
->setCategoryId(2)->setTemplate("catalog/product/list_home.phtml")->toHtml();
list_home.phtml
getChild('toolbar')->setCurrentMode('list'); //uses list mode
$_productCollection = $this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');
?>
count()): ?>
__('There are no products matching the selection.') ?>
--use code for listing---