Saturday, September 21, 2013

How do I get a reference to the current search results collection in magento

It is very pretty simple when you come to know.

$items = $this->getLayout()
                 ->getBlockSingleton('catalog/product_list')
                 ->getLoadedProductCollection();

Cool!!!

No comments:

Post a Comment