0

I need to show product listing based on Category id for which display mode ( under display settings) is set only to "Static Block Only".

So, In order to show product for this category i have created a CMS page and have set its Layout as

2Columns with left bar

and added below xml

    <reference name="content">
          <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
          <action method="setCategoryId"><category_id>3</category_id></action>
              <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
                   <block type="page/html_pager" name="product_list_toolbar_pager"/>
                            </block>
                            <action method="addColumnCountLayoutDepend"><layout>empty</layout><count>5</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>4</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>two_columns_left</layout><count>3</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>two_columns_right</layout><count>3</count></action>
                            <action method="addColumnCountLayoutDepend"><layout>three_columns</layout><count>2</count></action>
                            <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
                        </block>
</reference>

I get proper product list, but Layer Navigation filters are not working. Can any one please let me know what i am missing.

Thank You.

  • are you using any third party extension or check your category is Anchor yes or not – Amit Bera Sep 13 '14 at 8:01
  • I am not using any third party extension and "Is Anchor" is also set to Yes – Trimantra Software Solution Sep 13 '14 at 8:18
0

Magento treats category in two ways in terms of layout. ie for categories whose isAnchor property is set to YES as layered categories and which is set to NO as default categories. For layered categories, it will process catalog_category_layered layout handle while for default categories, instead of catalog_category_layered layout handle, it will use catalog_category_default. Both of these handles are defined inside catalog.xml.

For an example, for categories which has enabled with layered navigation filter, layout handle possess this section.

    <reference name="left">
        <block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"/>
    </reference>

This is what that process layered navigation section. This block is absent in catalog_category_default handle.

So my recommendation is, you need to use the layout definition that comes under catalog_category_layered for those categories that uses layered navigation. Means you need to copy that code from layout handle and paste it inside cms page layout section. Similarly for categories that do not have layered navigation, you need to use content inside catalog_category_default layout handle.

Dont forget to set category as you do here. Hope that will resolve your problem

| improve this answer | |
  • thanks for the explanation Rajeev, this isn't working for me though. I've copied xml code in to my 'New' category layout and the layered navigation still isn't showing – Pixelomo Mar 22 '16 at 14:35

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