skip to Main Content

I have create a custom theme. and I want to override searchlist file.

 vendor/magento/module-catalog-search/view/frontend/templates/searchlist.phtml

I move it in

public_html/app/design/frontend/themevendor/theme/Magento_CatalogSearch/

But its render output from vendor. I am new in magento2 so can you suggest me where am i wrong?

2

Answers


  1. in magento2 we can override the templates.
    for that we have to create directory structure like this:
    app/design/frontend/custom_vendor/custom_theme/Magento_CatalogSearch/templates/searchlist.phtml
    if you change in your overridden template file than you have to run three commands in order to get the proper output-

    php bin/magento cache:clean  
    php bin/magento cache:flush  
    php bin/magento setup:static-content:deploy -f 
    
    Login or Signup to reply.
  2. Move your file to your custom theme

    public_html/app/design/frontend/../../Magento_CatalogSearch/templates/searchlist.phtml

    And not need to deploy your custom theme. only run below command

    php bin/magento cache:flush
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search