Wednesday, 11 March 2015

Removing recently viewed products from left/right sidebar in magento

In magento, Recently viewed products is actually a default sidebar block. It may be on left side or right side depending on your theme layout. Whenever you view any product, it would be added under this block.

Now I am trying to remove this block from sidebar. Actually there may be more than one approach to do this, but I'll going to discuss two popular approaches here:

Approach 1: Go to app/design/frontend/base/default/layout/report.xml. Open this file with your favorite text editor (I'll prefer notepad++) and comment out following line :

<block type="reports/product_viewed" before="right.permanent.callout" name="right.reports.product.viewed" template="reports/product_viewed.phtml" />

But I don't like this approach because I'll never recommend to edit/change base files, however, you do not have to worry as I've got an another solution and it really worked for me. So, If you want to do this, I'll prefer this one :

Approach 2: In your Theme's local.xml file, under <default> section, put this line:

If your block is located at right side, then the line would be
                 <remove name="right.reports.product.viewed" />

If your block is located at left side, then the line would be
                 <remove name="left.reports.product.viewed" />

Enjoy e-commerce with magento !!!

Note: Tested over magento