Page 1 of 1

Does OCMOD still exist in 4.0?

Posted: Wed May 25, 2022 2:37 am
by Qphoria
I was looking to see how ocmod has changed with 4.0 and haven't seen any references to it in the code. Does it still exist?

Re: Does OCMOD still exist in 4.0?

Posted: Wed May 25, 2022 3:21 am
by uksitebuilder
Apparently not. It has been replaced by the 'Events' system.

see Daniel's News Announcement, 2nd line of the "Added" section and the "REMOVED" section: viewtopic.php?f=2&t=228481

Re: Does OCMOD still exist in 4.0?

Posted: Wed May 25, 2022 3:39 am
by Qphoria
Ah I was looking for some sort of announcement.. Thanks!

Re: Does OCMOD still exist in 4.0?

Posted: Wed May 25, 2022 2:33 pm
by OSWorX
Qphoria wrote:
Wed May 25, 2022 2:37 am
I was looking to see how ocmod has changed with 4.0 and haven't seen any references to it in the code. Does it still exist?
Already discussed here in this forum several times in the past - where have you been??

Re: Does OCMOD still exist in 4.0?

Posted: Wed May 25, 2022 11:27 pm
by Qphoria
LOL admittedly not been active in the forums much.

Re: Does OCMOD still exist in 4.0?

Posted: Thu May 26, 2022 12:14 am
by IP_CAM
Well, you most likely didn't miss much ... :laugh:

Re: Does OCMOD still exist in 4.0?

Posted: Thu May 26, 2022 7:40 am
by Johnathan
Glad you're still alive though :laugh:

Re: Does OCMOD still exist in 4.0?

Posted: Thu May 26, 2022 9:43 pm
by khnaz35
Seems someone already came-up with vQMOD for OC 4 so no need to convert the extensions for OC 4. Just little tweaks and vQMOD will do the job for OCMOD replacement.

Re: Does OCMOD still exist in 4.0?

Posted: Thu May 26, 2022 9:55 pm
by thekrotek
khnaz35 wrote:
Thu May 26, 2022 9:43 pm
Seems someone already came-up with vQMOD for OC 4 so no need to convert the extensions for OC 4. Just little tweaks and vQMOD will do the job for OCMOD replacement.
It was expected from the very beginning. It was absolutely unnecessary to remove OCMod, but nobody listens to developers when it comes to adding/removing features to OC.

Re: Does OCMOD still exist in 4.0?

Posted: Thu May 26, 2022 10:01 pm
by xxvirusxx
I think if a developer want, can create a patch to add back Ocmod.

Re: Does OCMOD still exist in 4.0?

Posted: Thu May 26, 2022 10:47 pm
by IP_CAM
xxvirusxx wrote:
Thu May 26, 2022 10:01 pm
I think if a developer want, can create a patch to add back Ocmod.
Great, it will then end up with about the same problems as experienced already in OC v.2.x and v.3.x :laugh:

Re: Does OCMOD still exist in 4.0?

Posted: Thu May 26, 2022 10:54 pm
by JNeuhoff
xxvirusxx wrote:
Thu May 26, 2022 10:01 pm
I think if a developer want, can create a patch to add back Ocmod.
I could port our Integrated VQmod (which supports both VQmod XML or OCmod XML) to OpenCart 4 if there is sufficient demand for it. It would work like the OpenCart 3 OCmod.

Having said that, XML-based modification systems are not the longterm solution. XML is a structured markup language for documents or protocols, it is not meant to be a programming language. What OpenCart really needs are more trigger points for events, and proper extension mechanisms, such as chained class extensions, support for decorator design patterns, etc.

The danger with XML based modifications for OC 4 is that we'll see all these poor quality extensions again.

The OpenCart marketplace really needs a quality control or vetting process of some sort for 3rd party extensions.

Re: Does OCMOD still exist in 4.0?

Posted: Thu May 26, 2022 11:29 pm
by IP_CAM
I could port our Integrated VQmod (which supports both VQmod XML or OCmod XML) to OpenCart 4
Well, that would at least solve this Problem for good, because otherwise, it will end up in Chaos again. You just have to make sure, that the 'Owner' of the VqMod Name will accept your Proposal, since VqMod seems to be a 'registered' Trademark Name, as quoted already by it's 'Owner'. You just have to accept the Fact, that OC-Newcomers have no Idea on such 'Details', and they use, what they get.
It would be a real Progress, to make OC v.4 to be a Success. ;)

Re: Does OCMOD still exist in 4.0?

Posted: Fri May 27, 2022 12:06 am
by khnaz35
Let's hope it work in all party favours.

Re: Does OCMOD still exist in 4.0?

Posted: Fri May 27, 2022 12:58 am
by xxvirusxx
JNeuhoff wrote:
Thu May 26, 2022 10:54 pm
The danger with XML based modifications for OC 4 is that we'll see all these poor quality extensions again.
Events should be used for extension/modules which make "changes" in the core and not to upload extension whitout core changes: like bank transfer payment, language files if will be the case....

https://github.com/opencart/opencart/di ... nt-2818749

Re: Does OCMOD still exist in 4.0?

Posted: Fri May 27, 2022 2:19 am
by by mona
This thread feels like we are in the presence of royalty.
Thank you to all of the legends in this thread. You all rock and always will.
Retro is in and vQmod is back
Long live the Queen !

Re: Does OCMOD still exist in 4.0?

Posted: Wed Jun 01, 2022 10:09 pm
by marvinkleinmusic
Is it even possible to edit the php files with the new event system?

Let's consider this example. I want to change the validation for the postcode to only accepts characters which are numeric.
catalog/controller/account/address.php

Line 293:

Code: Select all

if ($country_info && $country_info['postcode_required'] && (utf8_strlen($this->request->post['postcode']) < 2 || utf8_strlen($this->request->post['postcode']) > 10)) {
with ocmod I could search for this part and replace it with this code

Code: Select all

if ($country_info && $country_info['postcode_required'] && (utf8_strlen($this->request->post['postcode']) < 2 || utf8_strlen($this->request->post['postcode']) > 10 || !is_numeric($this->request->post['postcode']))) {
Is this possible with the event system? Or do I'll need to use VQMod to achive this?

Re: Does OCMOD still exist in 4.0?

Posted: Wed Jun 01, 2022 10:39 pm
by Qphoria
You could do it with events with something like this: viewtopic.php?f=144&t=221533
But as he says there its a bit convoluted as you need to handle the setup for the find/replace code yourself and effectively writing your own code for each change to do what vQmod already does at a wider scale with portable scripts.

The event system is powerful but I think it should be limited to calling functions based on a certain step triggered in the process.
For example if you want to send some data to a 3rd party marketing campaign, you could make an event to send that data after each of these (but not limited to) available events. Again these are just sample events but effectively show all the potential places some event can be "triggered"
before/after registration
before/after addtocart
before/after enter shipping address
before/after enter payment address
before/after enter coupon
before/after place order

So pretty much any "action" that you can do in the cart, can then call to some trigger which allows for custom "events" to be run or "functions" to be called that are assigned to that trigger event. But it isn't granular enough for changing small things like adding/removing fields or custom lines of code which is where vQmod comes in.