I wanted to overrid:


so I copied it to:


But the override is not working.

Please let me know how I can override it without creating a new module.

Thank you!

1 Answer 1


This won't work. I can't imagine any way to do it without the custom module, there are several clean ways, though, depending what you exactly want. Most wanted is using plugin pattern: Plugins docs

Another manner is using observer pattern if the feature you want to rewrite dispatches some events. More: Observer docs

Finally, if neither plugins nor observers suits your case you can use preference, which helps you to replace whole class. More: Preference tutorial

  • Thank you. You are right, cannot be done without custom module. I created custom module and used "preferences" method.
    – Abid Malik
    Commented Dec 19, 2017 at 10:18

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.