Skip to main content

How to fix Autocomplete template broken Porto Theme with Smile-SA elasticsuite

Create this file "default.xml" in your theme directory in this folder "{vendor}/{theme}Magento_Search/layout"

add this code in the file 

 

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="porto_header">
            <block class="Smile\ElasticsuiteCore\Block\Search\Form\Autocomplete" name="top.search" as="topSearch" template="Smile_ElasticsuiteCore::search/form.mini.phtml">
                <arguments>
                    <argument name="rendererList" xsi:type="array">
                        <item name="term" xsi:type="array">
                            <item name="title" xsi:type="string" translate="true">Search terms</item>
                            <item name="template" xsi:type="string">Smile_ElasticsuiteCore/autocomplete/term</item>
                        </item>
                        <item name="product" xsi:type="array">
                            <item name="title" xsi:type="string" translate="true">Products</item>
                            <item name="template" xsi:type="string">Smile_ElasticsuiteCatalog/autocomplete/product</item>
                        </item>
                        <item name="category" xsi:type="array">
                            <item name="title" xsi:type="string" translate="true">Categories</item>
                            <item name="template" xsi:type="string">Smile_ElasticsuiteCatalog/autocomplete/category</item>
                        </item>
                        <item name="product_attribute" xsi:type="array">
                            <item name="title" xsi:type="string" translate="true">Attributes</item>
                            <item name="template" xsi:type="string">Smile_ElasticsuiteCatalog/autocomplete/product-attribute</item>
                            <item name="titleRenderer" xsi:type="string">Smile_ElasticsuiteCatalog/js/autocomplete/product-attribute</item>
                        </item>
                    </argument>
                </arguments>
            </block>
        </referenceContainer>
    </body>
</page>

 

reference URL 

https://github.com/Smile-SA/elasticsuite/issues/1112#issuecomment-426837492