CMS page with layered navigation not working

前端 未结 4 1192
無奈伤痛
無奈伤痛 2020-11-30 15:27

I\'ve added a CMS page wich shows all the products listed under the \"All Products\" category by creating a CMS page with a \"two column with left sidebar\" layout, and in t

相关标签:
4条回答
  • 2020-11-30 16:11

    To display layered navigation on cms page you have to set root category to Is Anchor=Yes.

    0 讨论(0)
  • 2020-11-30 16:11

    One possible reason layered navigation does not show is because you also need to configure your attributes to show in layered navigation.

    0 讨论(0)
  • 2020-11-30 16:19

    Please check the below link for calling layer navigation in CMS Page

    http://www.webdesign-gm.co.uk/news/web-design/magento-web-design/layered-navigation-on-home-page-or-any-cms-page-magento.php

    Or you can try this Design tab->Page Layout->Layout Update XML:

     <reference name="left">
            <!-- Layered Navigation Block -->
            <block type="catalog/layer_view" name="catalog.leftnav" template="catalog/layer/view.phtml" >
                    <action method="setCategoryId"><category_id>40</category_id></action>
            </block>
    </reference>
    
    <reference name="content">
            <block type="catalog/product_list" name="home" template="catalog/product/list.phtml">
    
                    <!-- Product List View -->
                    <action method="setCategoryId"><category_id>40</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="setToolbarBlockName"><name>product_list_toolbar</name></action>
    
            </block>
    </reference> 
    
    0 讨论(0)
  • 2020-11-30 16:22

    Open CMS->Pages->[your page] in Magento Admin Panel. Add the following layout instructions to Design tab->Page Layout->Layout Update XML

    <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>6</count>
    
      </action>
    
      <action method="addColumnCountLayoutDepend">
    
          <layout>one_column</layout>
    
          <count>5</count>
    
      </action>
    
      <action method="addColumnCountLayoutDepend">
    
          <layout>two_columns_left</layout>
    
          <count>4</count>
    
      </action>
    
      <action method="addColumnCountLayoutDepend">
    
          <layout>two_columns_right</layout>
    
          <count>4</count>
    
      </action>
    
      <action method="addColumnCountLayoutDepend">
    
          <layout>three_columns</layout>
    
          <count>3</count>
    
      </action>
    
      <action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
    
    </block>
    

    <block type="catalog/layer_view" name="cms_layer" as="cms_layer" before="-">
    
        <action method="setCategoryId"><category_id>3</category_id></action>
    
    </block>
    

    Also insert ID of desired category in 3 (2 times). Open desired category of your store through Catalog->Manage Categories. Make sure that Is Anchor=Yes on Display Settings tab.

    0 讨论(0)
提交回复
热议问题