Add OCMOD (XML) in Opencart 4 - Suggestion #10883
Replies: 17 comments 62 replies
-
OCmod is a curse, and I am glad it's not part of OpenCart 4 anymore! It's usually poor quality extensions which tend to make excessive use of OCmod instead of using event handlers. |
Beta Was this translation helpful? Give feedback.
-
Perhaps a better approach would be to introduce more triggers, especially for library classes. With regards to template changes: This can be tricky either way, whether OCmod or event handler, because of the need to find certain HTML elements in the DOM tree, for them to be modified, inserted before, or inserted after. This might be a scenario where Twig's built-in mechanism of template inheritance might come in handy, see e.g. https://twig.symfony.com/doc/3.x/templates.html#template-inheritance The good news is that the lack of OCmod discourages developers from doing quick unneeded dirty template changes. |
Beta Was this translation helpful? Give feedback.
-
It's a foreseeable Fact, that VqMod will further be used in latest OC v.4 Versions, so, also still adding OcMod, will, at best, result in beeing confronted with the same problems, as many older Version OC Users already experienced in the past. So, it really makes not much sense, to add OcMod again, considering the known fact, that VqMod had some advantages over OcMod, according to what I have been reading about. Just to add my Swiss Cheese to this ... |
Beta Was this translation helpful? Give feedback.
-
Quite funny that after nearly 3 years, the "folks" see that Events are the only proposed method to work with OC 4 .. Time to wake up - rest in piece VQ- & OCMod. |
Beta Was this translation helpful? Give feedback.
-
@osworx Events will never completely replace OCMOD, they are very different tools and with different uses, what I can do with OCMOD is not the same thing as with Events, but I can do everything that Events does with OCMOD, that's the point, I also consider the repository as a good place to discuss this kind of idea. I'm just suggesting something that I consider essential, if someone proves to me that Events can do everything that OCMOD does and with the same quality and performance, then it would make sense for Events to replace OCMOD, but Events has been around for years and I kept using it without problems OCMOD, because I think it is much superior in many uses and always got 100%, there is something more beautiful than being able to change any location of a code without directly messing with it, generating a Cache, logs and being easily possible to adapt to a time, disable or remove. The main point is OCMOD > Events, so if you want to discontinue OCMOD I think you would need a tool as good and complete as it could be, it could even be an OCMOD with another name. And a flaw of many is to think that OCMOD is related to a bad module, when in fact a bad module depends 100% on who makes it, I make very good modules and I love using OCMOD, I have been working with Opencart for over 10 years since 1.4 and his great differential was always being able to make XML that does magic without touching 1 line of code in the original. I haven't seen debates about discontinuing OCMOD, but I still think it's worth rethinking about it, there are thousands of modules that use it and that Events won't be able to meet 100%, I want to see create an Event that changes the Opencart library, which changes in various locations in the View, which changes a new Controller without prepared triggers, etc. |
Beta Was this translation helpful? Give feedback.
-
Those who are defending OC 4 for removed OCMOD probably doing only Tutorial Extensions. What is benefit from removing OCMOD ? I was waiting some upgrades for events as it was announced that OC4 wont have OCMOD, but nothing added. Funny how much code needed to change TWIG with Events. RIP OC 4.0.0.0 |
Beta Was this translation helpful? Give feedback.
-
OCMOD / vQmod is the Opencart biggest competitive advantage. |
Beta Was this translation helpful? Give feedback.
-
But no worries, if Opencart 4 have no native OCMod in it, every store will just have OCMod/vQmod installed additionally. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
speed "OcMod" str_replace = speed "Theme Editor (Cache Theme)" str_replace |
Beta Was this translation helpful? Give feedback.
-
I thought of two possible solutions:
I don't know what stage Events is in and as I've commented before in my view its use should be for triggers only, I would even give it another name if it's to have a type of OCMOD inside rs and it would be necessary to be able to deal with adaptations/conflicts easily. The cool thing about a migration tool that those who like XML could continue creating XML and the converter would turn into PHP (Events or the name of the new tool)
I prefer to avoid 2), but if it is not possible to return OCMOD to the base and 1) is not possible/feasible, it may be the single most practical option to keep modules made in OCMOD working in Opencart 4. |
Beta Was this translation helpful? Give feedback.
-
Hello, guys, how has your experience been with vQmod, Events or how have you managed to deal with the detail of not having OCMOD in Opencart 4 anymore? At the moment I haven't started to move the modules to Opencart 4, I will probably use vQmod, while there is no way to have all the features of OCMODs in Opencart 4. Has anyone using vQmod been doing well in Opencart 4? |
Beta Was this translation helpful? Give feedback.
-
Yes, we have. No problem using event handlers. There is no need for OCmod or VQmod. Of course, there are still other bugs to be addressed in OpenCart 4 before it become usable for live sites. |
Beta Was this translation helpful? Give feedback.
-
I did some tests with the use of vQmod in Opencart using the same OCMOD XMLs and it got directly successfully 😃 👍 💯 Maybe they could go back to OCMOD or something like that, but as an optional use as it always was, whoever wants to use the X, Y, Z tool, giving more freedom and options to the developer. I will continue using XML for what is recommended in conjunction with model, controller, library and etc as I have always done in more than 10 years of development with Opencart and I can guarantee it is excellent this way and without touching 1 line of code in original files of the Opencart, leaves the code 100% isolated from the Opencart code and facilitates maintenance/support, in addition to high performance, as a cache is generated with the changes. Just a recommendation to avoid using the Administrator's theme editor, as it never worked with OCMOD and should not work with vQmod, as it saves changes in the Bank and not in a file. |
Beta Was this translation helpful? Give feedback.
-
It's good that OCmod got abandoned, XML is a markup language for documents and protocols, it's not a programming language. The number of poor-quality OCmod and/or VQmod based extensions is countless. |
Beta Was this translation helpful? Give feedback.
-
When OCMOD is back? |
Beta Was this translation helpful? Give feedback.
-
Hi, congratulations Daniel , team and all contributors, I was looking forward to Opencart 4 :) and to be able to create modules and themes for it.
I found it interesting to have fewer base extensions, so each user installs the desired one, I just really missed OCMOD (XML) I consider it the great and perhaps the best differential of Opencart 3 and 2 and basically every module is made using it, even if it's just to inform the version or other details.
Events is interesting, but I consider OCMOD much more powerful, with it I can change any Opencart file, be it controller, model, view or other without touching the original file and best of all, except file dependency, I can even assemble one controller without creating a file for it for example, it also facilitates maintenance and editing.
In the View itself is the great power of OCMOD, I can do it by installments in the products, let me know, change CSS, put JS in several desired places, in short, if there is a line to be researched to be done with OCMOD, since Event I believe that be much more limited.
I would recommend going back to OCMOD, I don't see the point in taking the same, even more being a great differential of Opencart and used by thousands of modules, much easier to keep 1 XML file than several PHP and Events files and I believe that Events have limitations mainly in the view , I don't know if it will be possible in any line to add something, remove something or change something.
It will also be very complex for most developers to maintain 2 totally different modules between Opencart 3 and 4, since in 3 most use OCMOD.
Every module I create has at least 1 XML (OCMOD), because I use it to inform the version, I can change the controller I use to pull the Module version without changing 1 single file directly and everything created with Cache generated by OCMOD, no excess of if or for, a simple Cache with the changes applied.
I believe that most of my colleagues also almost always use OCMOD, because it avoids excess files and having to move directly in certain files, I think it's so good, that since version 1.4 of Opencart I've been using vQmod and then OCMOD in 2 and 3 and I've always preferred over event, hooks and other ways, because we have more control, more freedom, easy to disable or change and it's also easy to check the Not Found and adapt to non-standard themes, which unfortunately is the majority.
Beta Was this translation helpful? Give feedback.
All reactions