Page 1 of 1

Extension that modifies core files.

Posted: Thu Apr 28, 2022 3:18 pm
by shashank1992
Hi,
My extension adds a new column to the order info page in admin. How can I make this extension without modifying core files.

thanks

Re: Extension that modifies core files.

Posted: Thu Apr 28, 2022 5:30 pm
by kestas
shashank1992 wrote:
Thu Apr 28, 2022 3:18 pm
Hi,
My extension adds a new column to the order info page in admin. How can I make this extension without modifying core files.

thanks
Use Events

Re: Extension that modifies core files.

Posted: Thu Apr 28, 2022 5:32 pm
by IP_CAM
You could add the Extension Content into the corresponding Core Files, to make it work, but without modifying the core files in charge, changes cannot work.

Re: Extension that modifies core files.

Posted: Thu Apr 28, 2022 5:52 pm
by JNeuhoff
IP_CAM wrote:
Thu Apr 28, 2022 5:32 pm
You could add the Extension Content into the corresponding Core Files, to make it work, but without modifying the core files in charge, changes cannot work.
Actually, there is no need for modifying core files. A simple event handler for the trigger admin/view/sale/order_info/before should do the job.

Re: Extension that modifies core files.

Posted: Thu Apr 28, 2022 7:17 pm
by IP_CAM
Well, that might be so, but I assume, that 'creating events' has little or no meaning for most OC Users, asking such questions... ??? :D

Re: Extension that modifies core files.

Posted: Thu Apr 28, 2022 9:44 pm
by grgr
IP_CAM wrote:
Thu Apr 28, 2022 7:17 pm
Well, that might be so, but I assume, that 'creating events' has little or no meaning for most OC Users, asking such questions... ??? :D
There is quite a bit of good information about all such mattter now available.
Here is the place to start:
viewtopic.php?t=227710

Re: Extension that modifies core files.

Posted: Fri Apr 29, 2022 12:16 am
by straightlight
IP_CAM wrote:
Thu Apr 28, 2022 7:17 pm
Well, that might be so, but I assume, that 'creating events' has little or no meaning for most OC Users, asking such questions... ??? :D
Their opinion. The engine is built-in the core wanted or not on anyhow and still takes the lead on the MB.

Re: Extension that modifies core files.

Posted: Fri Apr 29, 2022 12:17 am
by straightlight
shashank1992 wrote:
Thu Apr 28, 2022 3:18 pm
Hi,
My extension adds a new column to the order info page in admin. How can I make this extension without modifying core files.

thanks
OC version. Vague info. Posted in the wrong forum section.

Re: Extension that modifies core files.

Posted: Fri Apr 29, 2022 3:26 pm
by OSWorX
IP_CAM wrote:
Thu Apr 28, 2022 7:17 pm
Well, that might be so, but I assume, that 'creating events' has little or no meaning for most OC Users, asking such questions..
Not only might be so, it IS so that events are the way to go (especially when OpenCart 4.x will be published)!
Everything else is old and "out fashioned".

And the "question" does not comes from a "user", more from a so called "developer" who does not know what he is doing!

Re: Extension that modifies core files.

Posted: Fri Apr 29, 2022 8:00 pm
by straightlight
It is not only from the fact that a so-called developer may not know what he's doing but also from those who knows what they're doing but simply rather takes chances to search for core lines in existing codes whereas these lines can interfere with other extensions without being aware of it as opposed to the use of Event Triggers.