caciobanu / improved-magento-layered-navigation

This project has reached its end-of-life (EOL).
MIT License
138 stars 54 forks source link

Work with root category on homepage #113

Closed greatwitenorth closed 5 years ago

greatwitenorth commented 7 years ago

I'm displaying the layered nav on my homepage using the root category. I've created a cms page that is set to my home page with the following layout updates:

<reference name="left">
    <!-- Layered Navigation Block -->
    <block type="catalog/layer_view" name="catalog.leftnav" before="-" template="catalin_seo/catalog/layer/view.phtml" >
            <action method="setCategoryId"><category_id>90</category_id></action>
    </block>
</reference>

<reference name="content">

    <block type="catalog/product_list" name="product_list" template="catalin_seo/catalog/product/list.phtml">
        <!-- Product List View -->
        <action method="setCategoryId"><category_id>90</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 type="core/text_list" name="product_list.name.after" as="name.after" />
        <block type="core/text_list" name="product_list.after" as="after" />         
    </block>

</reference>

I've also had to add the following in order to get the js and css from this module displaying on the homepage:

<cms_page>
        <reference name="head">
            <action method="addItem">
                <type>skin_css</type>
                <name>css/catalin_seo/style.css</name>
            </action>
            <action method="addItem">
                <type>skin_js</type>
                <name>js/catalin_seo/native.history.js</name>
            </action>
            <action method="addItem">
                <type>skin_js</type>
                <name helper="catalin_seo/getSkinJsUrl"/>
            </action>
        </reference>
    </cms_page>

It's now showing correctly, but when I click a filter (I have ajax enabled) the endpoint that it fetches returns a 404 (ie mydomain.com/filter/cat/100-treadmills.html). I assume this has to do with the fact that because I'm not in a category, Improved layered nav isn't handling the request.

Is there any way to get this module working so that I can utilize the layered nav on the homepage?