0

I have set new theme and all page are working fine but the catalog search page are blank....

Here i Ad my

/public_html/app/design/frontend/{Vendor}/{Project}/Magento_CatalogSearch/layout Default.XMl

    <?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" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="top.search">
            <block class="Magento\Framework\View\Element\Template" name="advanced-search-link" template="Magento_CatalogSearch::advanced/link.phtml" />
        </referenceBlock>
        <referenceBlock name="footer_links">
            <block class="Magento\Framework\View\Element\Html\Link\Current" name="catalog-search-advanced-link">
                <arguments>
                    <argument name="label" xsi:type="string" translate="true">Advanced Search</argument>
                    <argument name="path" xsi:type="string">catalogsearch/advanced</argument>
                    <argument name="attributes" xsi:type="array">
                        <item name="data-action" xsi:type="string">advanced-search</item>
                    </argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

Front End Image

http://prntscr.com/sb9kok

3
  • check console error ... Commented May 5, 2020 at 12:30
  • run the page and check console network tab error.And find any red color file.click file and check Commented May 5, 2020 at 12:38
  • You can also show all php errors. Add this in index.php to see magento errors: ini_set('display_startup_errors', 1); ini_set('display_errors', 1); error_reporting(-1); Commented May 5, 2020 at 13:33

1 Answer 1

0

You need to add below line in top of your themes "result.phtml" file at path app/design/frontend/{Vendor}/{Project}/Magento_CatalogSearch/templates/

$productList = $block->getProductListHtml();

So your file starting should look like below :

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile
$productList = $block->getProductListHtml();
?>
<?php if ($block->getResultCount()): ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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