You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In CompanyName/Search/Controller/Search/Result.php, i have used this code -
namespace CompanyName\Search\Controller\Search;
class Result extends \Magento\CatalogSearch\Controller\Result\Index
{
public function execute($coreRoute = null)
{
return parent::execute($coreRoute);
}
}
in view/frontend/layout/, i have created catalogsearch_result_index.xml and used
< referenceContainer name="content" >
< block class="CompanyName\Search\Block\Search" template="CompanyName_Search::search/result.phtml" / >
< /referenceContainer >
4. created template file and put my code there.
After doing all this, it is appending my content to magento default search result.
but i want to override this. Please help me to do this is in appropriate way.
The text was updated successfully, but these errors were encountered:
I am trying to override Search result page to show my own template.
I have did --
< preference for="Magento\CatalogSearch\Controller\Result\Index" type="CompanyName\Search\Controller\Search\Result" / >
namespace CompanyName\Search\Controller\Search;
class Result extends \Magento\CatalogSearch\Controller\Result\Index
{
public function execute($coreRoute = null)
{
return parent::execute($coreRoute);
}
}
< referenceContainer name="content" >
< block class="CompanyName\Search\Block\Search" template="CompanyName_Search::search/result.phtml" / >
< /referenceContainer >
4. created template file and put my code there.
After doing all this, it is appending my content to magento default search result.

but i want to override this. Please help me to do this is in appropriate way.
The text was updated successfully, but these errors were encountered: