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.

Thanks

有帮助吗?

解决方案

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
许可以下: CC-BY-SA归因
scroll top