I'm trying to override a layout .phtml file for a 3rd party extension which is located in /var/vendor_name/extension. As I understand, I should not be modifying the /vendor files, but this extension has no files located in the app/code or app/frontend.

The file I'm trying to override is located in <magento_root>/vendor/vendor_name/module_name/view/frontend/templates/product/view/list.phtml

I read through the following thread but I'm not sure how to apply it in my situation Magento 2: How to Override File in Vendor Folder

Please let me know if more information needed.


1 Answer 1


You can do that two ways:

  1. Create a module and overwrite the template
  2. Copy that template under your current theme

Here is the solution for #2.

  1. Create a directory VendorName_ModuleName under app/design/frontend/ThemeVendor/ThemeName/
  2. Copy templates/product/view/list.phtml to app/design/frontend/ThemeVendor/ThemeName/VendorName_ModuleName/templates/product/view/list.phtml
  • Hi Sohel, thanks for the response. I did as you outlined in #2 and I worked, sort of. The area on my page that I'm trying to modify is now empty so it seem the new file is being recognized. I'm now getting a 500 error and nothing that I put on the new .phtml file will show up in the browser. Could it be because the working directory of the file has changed and some of the previous file/class name references are now invalid? Any ideas on how to trouble shoot or more info I can provide. Thanks again!.
    – mkutev
    Apr 14, 2021 at 5:15
  • Can you post here the original error from php error_log/system.log/exception.log?
    – Sohel Rana
    Apr 14, 2021 at 5:21
  • Hi again, I had made a mistake trying to log something to console and that is why nothing is loading. Your solution #2 worked for me. All I have to do is clear cache and my changes show up. Cheers!
    – mkutev
    Apr 14, 2021 at 16:55

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.