random products in list.phtml template in magento

Go To StackoverFlow.com

1

Below is the code to get list of products on a category page in list.phtml.

$_productCollection=$this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');

I want another section below this list where I can list random products of any category. can I do something to tweek this same function and reuse it ?

It would be really easy if I could use the same helper.

I wanted a section for " you might be intrested in these " and I show random products there.

Thanks Ab

2012-04-05 00:35
by abnab


1

I can't imagine something in Magento being as simple as:

shuffle($_productCollection);
2012-04-05 04:54
by pspahn


0

In XML where you should define your block, something like this:

<block type="catalog/product_list_random" template="your random template" name="random" />

and in the category view page simply make call to your template like

echo $this->getChildHtml('random');
2012-04-05 06:42
by Jevgeni Smirnov
Ads