Magento – how to display recently viewed products in cms block and call it in details page

magento-1.9

I wanted to display the recently viewed products in the cms/block and call it in product details page.

This is the line I gave in cms/block:

<p>{{block type="reports/product_viewed"template="reports/product_viewed.phtml"}}</p>

And in view.phtml I included this part:

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('product_details_tab')->toHtml() ?>

But nothing is getting displayed. Where have I went wrong?

Best Answer

call this in your phtml instead

<?php echo $this->getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->toHtml(); ?>
Related Topic