chritaso
chritaso

Reputation: 613

Get recently viewed products array in Magento

I've got the problem that i have to highly customize a magento ecommerce shop. Therefore it would be great if i could have the data requested in

\app\design\frontend\avalanche\default\template\reports\product_viewed_details.phtml

via

$this->getRecentlyViewedProducts()




I already tried to get it via

Mage::getBlockSingleton('report/product_view')->getRecentlyViewedProducts();

, but the only thing i get is an empty array.


Could someone please help me? I'm driving a little bit crazy over here.

Upvotes: 4

Views: 9748

Answers (2)

Kamil Szymański
Kamil Szymański

Reputation: 950

You can also use aliases, to produce more 'friendly' code:

$collection = Mage::getBlockSingleton('reports/product_viewed')->getItemsCollection();

Upvotes: 1

Fran
Fran

Reputation: 670

Have you tried :

$collection = Mage::getSingleton('Mage_Reports_Block_Product_Viewed')->getItemsCollection();

Upvotes: 15

Related Questions