1

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?

1 Answer 1

2

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.

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.