|Register On Nairaland / LOGIN! / Trending / Recent / New|
Stats: 2,906,363 members, 7,006,661 topics. Date: Monday, 08 August 2022 at 05:43 PM
|How To Override A Core Class In Magento 2 by Anthonynguyen(m): 3:43am On Jul 20, 2019|
When you need to override a core class in Magento 2, you can handle this by using Preference or Plugin.
In Magento 2, Preference extends a core class. It can rewrite function. When you declare a Preference, your new class is expected to be a complete implementation of the class you want to override.
While a plugin allows you to execute your functions before, after or around (before & after) the core function is executed. It's NOT really rewritten function like Preference.
For more information: https://store.magenest.com/blog/how-to-override-core-class-magento-2/
|Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health |
religion celebs tv-movies music-radio literature webmasters programming techmarket
Nairaland - Copyright © 2005 - 2022 Oluwaseun Osewa. All rights reserved. See How To Advertise. 21