I am trying to override a template file in another module using a preference:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Mageplaza\QuickOrder\View\Frontend\Web\Template\Add_multiple" type="Mymodule\QuickOrder\View\Frontend\Web\Template\Add_multiple"/>

This is the real path: Mageplaza\QuickOrder\view\frontend\web\template\add_multiple.html

My module real path: Mymodule\QuickOrder\view\frontend\web\template\add_multiple.html

I am not sure if I should have: Add_multiple or Add_Multiple or AddMultiple or Addmultiple

I have tried all of them yet none of them work. Does anyone have any idea how to override this file?

1 Answer 1


A preference doesn't work for templates, it is designed to override Magento 2 classes.

The simplest way is to override this template file in your custom theme, or alternatively modify the Block to use your own named template file. Change this using layout files.

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.