2

this is my xml code:

    <catalog_category_default>
     <remove name="right.reports.product.viewed" />
    </catalog_category_default>

I am trying to remove the recently viewed products from all category and subcategories pages. How can I do that?

2
  • the code smeed to be right.can you please tell me where u have put this.
    – Amit Bera
    Commented Sep 30, 2015 at 14:40
  • it is in the layout folder from my theme and I cleared the cache from admin panel Commented Sep 30, 2015 at 14:42

5 Answers 5

3

At magento,catalog_category_default handler is created on category page whenever that category is non- Anchor.

catalog_category_default does not exit at Anchor category means layer navigate category,

That you need fine a handler which is create both on Anchor category and Non Anchor category

Magento is automatically create few handler whenever loadLayout() called.

From their list, one of handler is inserted at current layout on basic of current controller action full Name [Mage_Core_Controller_Varien_Action::getFullActionName()].

That means ,whenever a category layout loaded,that time a handler is created and it name is catalog_category_view .

And it does not depends on Anchor field of category.

so.you can use catalog_category_view handler for removing recently viewed products from all category and subcategories pages. .

4
  • but what about subcategories? In the subcategories are still there if I use catalog_category_view or catalog_category_default Commented Oct 1, 2015 at 8:01
  • for all category & it subcategory... this handler are createing always..... but for research page you need to use catalogsearch_result_index
    – Amit Bera
    Commented Oct 1, 2015 at 8:03
  • I used this : <catalog_category_default> <remove name="right.reports.product.viewed" /> </catalog_category_default> <catalog_category_view> <remove name="right.reports.product.viewed" /> </catalog_category_view> and they are still there only in the subcategories . I don;t get it Commented Oct 1, 2015 at 8:06
  • it was the cached :| thx Commented Oct 1, 2015 at 8:08
3

You should use a different layout handle. Put it between catalog_category_layered instead

<catalog_category_layered>
    <remove name="right.reports.product.viewed" />
</catalog_category_layered>
1

You can use this to remove the block from all category list pages (layered or not):

<catalog_category_view>
    <remove name="right.reports.product.viewed" />
</catalog_category_view>
0

If your category "isAnchor" (i.e. It has products in) it will need to be put in the catalog_category_layered handle instead.

As Amit has pointed out though, catalog_category_view will cover both.

0

Goto \app\design\frontend\default\theme\layout\reports.xml

Comment Below line

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

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.