Home    Articles


How to edit magento recently viewed products


The recently viewed products template in magento si located in /app/design/frontend/[YOUR THEME]/template/reports/product_viewed.phtml , if is not there, search in the BASE folder.


Here you can change the layout, the style and lots more.

In this template magento uses a function to get the recently viewed products.
The products have no image by default but this can be added quicky by geting the product image like i did in thistutorial.

This recently viewed products template is showed in the right side of magento, this can be moved to the left side if you want by editing the catalog.xml file.

If recently viewed products needs to be added in the middle side of the website you can use this code to add it anywhere:

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

If you use the admin->cms to add this recently viewed products use this string to add it:
{{block type=”reports/product_viewed” template=”reports/product_viewed.phtml”}}


…first time posted on w3bdeveloper.com