Override Extension (/vendor) in app/frontend
-
16-04-2021 - |
سؤال
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:
- Create a module and overwrite the template
- Copy that template under your current theme
Here is the solution for #2.
- Create a directory VendorName_ModuleName under app/design/frontend/ThemeVendor/ThemeName/
- Copy templates/product/view/list.phtml to app/design/frontend/ThemeVendor/ThemeName/VendorName_ModuleName/templates/product/view/list.phtml
لا تنتمي إلى magento.stackexchange