Question

I have a module in vendor/company/module. I have created the following folder to override files. /vendor/theme/theme-frontend-default/Company_Module.

I am able to override files in view folder but I also want to override model and maybe di.xml if required. Creating di.xml in /vendor/theme/theme-frontend-default/Company_Module/etc/frontend/di.xml does not override. Is there a different way to override di.xml or models?

Was it helpful?

Solution

di.xml files and models are considered "backend" code. Themes only deal with frontend code: layout, template, css/less, javascript, images, etc.

You must create a module to accomplish those backend tasks. I usually just create a module called MageModule_ThemeHelper or something like that just so I know its sole purpose is to help my theme.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top