In my store recently viewed products name only displayed, i need to visible images of recently viewed products.

enter image description here

  • check my code and comment me whether it is working or not please confirm me jeeva. thanks Mar 23, 2017 at 8:53

2 Answers 2


I have tried and got the solution add the below piece of code in the product_viewed.phtml in the specified path in between li tag


   <li class="item">
    <a href="<?php echo $_item->getProductUrl($_item) ?>">
    <span class="product-image">
    <img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(50, 50)->setWatermarkSize('30x10'); ?>" width="50" height="50" alt="<?php echo $this->escapeHtml($_item->getName()) ?>" />
    <p class="product-name"><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->helper('catalog/output')->productAttribute($_item, $_item->getName() , 'name') ?></a></p>


Modified to add images

<?php if ($_products = $this->getRecentlyViewedProducts()): ?>
<strong><span><?php echo $this->__('Recently Viewed Products') ?></span></strong>
<ol id="recently-viewed-items">
<?php foreach ($_products as $_item): ?>
<p><img src="<?php echo $this->helper('catalog/image')->init($_item, 'small_image')->resize(50, 50) ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" /> </p>
<p><a href="<?php echo $this->getProductUrl($_item) ?>"><?php echo $this->helper('catalog/output')->productAttribute($_item, $_item->getName() , 'name') ?></a></p>
<?php endforeach; ?>
<script type="text/javascript">decorateList('recently-viewed-items');</script>
<?php endif; ?>

That’s it, you should now have product thumbnails above your product name, if not refresh your cache and then see if it works

  • There is no "reports" path in my root folder
    – Gem
    Sep 6, 2016 at 6:12
  • I f you have fresh magento installed check via rwd theme.
    – Arjun
    Sep 6, 2016 at 6:14
  • How can i use in my manual template
    – Gem
    Sep 6, 2016 at 6:15
  • I think you need to override product_viewed.phtml in your theme.
    – Arjun
    Sep 6, 2016 at 6:20
  • Am just replaced with your code, its not working,
    – Gem
    Sep 6, 2016 at 6:20

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.