0

I need Layered Navigation in advance search result

enter image description here

Here is the code of my file.

httpdocs/app/design/frontend/Smartwave/porto/Magento_CatalogSearch/layout

<?xml version="1.0"?>
 <!--
 /**
   * Copyright © Magento, Inc. All rights reserved.
   * See COPYING.txt for license details.
  */
 -->
 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" 
  xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <head>
    <title>Advanced Search</title>
  </head>
   <update handle="page_calendar"/>
  <body>
   <referenceContainer name="sidebar.main">
        <block class="Magento\LayeredNavigation\Block\Navigation\Category" name="catalog.leftnav" 
 before="-" template="layer/view.phtml">
        <block class="Magento\LayeredNavigation\Block\Navigation\State" 
 name="catalog.navigation.state" as="state" />
        <block class="Magento\LayeredNavigation\Block\Navigation\FilterRenderer" 
 name="catalog.navigation.renderer" as="renderer" template="layer/filter.phtml"/>
        </block>
    </referenceContainer>
    <referenceContainer name="content">
        <block class="Magento\CatalogSearch\Block\Advanced\Form" name="catalogsearch_advanced_form" 
 template="Magento_CatalogSearch::advanced/form.phtml"/>
        <block class="Magento\Framework\View\Element\Html\Calendar" name="html_calendar" 
 as="html_calendar" template="Magento_Theme::js/calendar.phtml"/>
    </referenceContainer>
 </body>
 </page>
  • If you need show layered navigation for some attribute then please enable it in backend. Go to stores > attributes > product, find and open needed attribute (for example price) and on tab "Storefront Properties" configure "Use in Search Results Layered Navigation" - Yes ?? – Mohit Patel Apr 9 at 11:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.