override vendor xml file in magento 2
Question
Dears,
I have a xml file in the vendor directory:
vendor/the_vendor/the_module/view/frontend/layout/the_file.xml
I know that I should never make any change in this directory as it may be overrided by composer.
I also know that I should create the the_file.xml
in my theme.
my theme path is:
app/design/frontend/the_Vendor/My_Theme/
Could you please let me know where the the_file.xml should be created (the exact path) in order to override the vendor xml file ?
Solution
Try this way...
vendor/the_vendor/the_module/view/frontend/layout/the_file.xml
to
app/design/frontend/Vendor/Themename/the_module/layout/the_file.xml
Please don't forget to clear cache after change in xml files
OTHER TIPS
Please look at magento 2 documentation
Reference:
https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/layouts/layout-override.html
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange