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

This code suppose to output the recently viewed products on category page or product page (by inserting the code in .phtml files). and this has been always working for me on my Magento sites.

However I have experienced that for one site (Magento 1.9.3.3), this code isn't working at all. and for this site, the widget to show recently viewed product doesn't work either.

Any ideas what can cause the "recently viewed products" isn't working?

  • 1
    This code looks good, not sure why not working for you. – Sohel Rana Apr 28 at 16:21
  • @SohelRana Can it be the custom themes that cause the issue, or this code will output the recently viewed products regardless the theme? – Magento Learner Apr 28 at 19:53
  • This code is not depends on theme. But if your module overwrite template or something this would be problem. – Sohel Rana Apr 29 at 4:51
  • @SohelRana This code is working now, without I've done anythong. It's wierd. Can cron job effect this? – Magento Learner May 10 at 8:18
0

Please Check whether your static block is whitelisted in admin panel, this could be one of the reasons the widget content might not be showing up in the frontend.

Refer the below link

Static Block Whitelist issue

  • Just checked. Everything is set to allowed under system -> permissions -> blocks – Magento Learner Apr 27 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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