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?

  • <p>{{block type="reports/product_viewed" template="reports/product_viewed.phtml"}}</p> Commented Sep 19, 2016 at 6:56

2 Answers 2


call this in your phtml instead

<?php echo $this->getLayout()->createBlock('reports/product_viewed')->setTemplate('reports/product_viewed.phtml')->toHtml(); ?>
  • No exactly I want to display the recently viewed products inside a tab content in cmsblock . So that is the reason i want to give it in block and then call in view.phtml
    – Ramya
    Commented May 31, 2016 at 11:07

Your code looks ok

 1. Do Re-Indexing from Admin > System > Index Management.
 2. Refresh Statics from Admin > Report > Products > Most Viewed.
 3. Check Recently Viewed/Compared Products count from 
System -> Configuration -> Catalog -> Recently Viewed/Compared Products
 4. Refresh Cache 

Now try.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.