eCommerce
Biggest Differences Between vQmod and OCMOD
Having two or more ways to do something can be a good thing, but it can also sometimes backfire. When it comes to OpenCart, there are four ways to modify its core files: vQmod, OCMOD, Override Engine and Event Handlers.
Let’s take a look at vQmod and OCMOD and the differences between these two.
What is vQmod and How Does it Work?
vQmod (or Virtual Quick Mod) is the most widely used of the four override systems I mentioned earlier. Basically, what it does is that it creates changes as XML search/replace script files. This means vQmod doesn’t make any direct changes to the core files.
The script files vQmod creates are parsed while the page loads and each “source” core file is loaded with one of these PHP functions: require or include. After this, the source is patched with the changes made to the script file and is saved to a temp file, which “moves out of the way” of the original during execution.
Thanks to this, the original source file is never “messed with" and the change is basically “virtual”.
Who Can Use vQmod?
The initial idea behind vQmod was to be used with OpenCart and in PHP. However, that doesn’t mean vQmod is limited to either of these two. In fact, the class can work with just about any eCommerce platform you have in mind.
Of course, this means you would have to figure out how the” include” and “require points” work on the specific platform in order to make the changes needed to install vQmod, which assumes that the index.php either does the includes itself or it calls other controller files to load the includes.
What are vQmod’s Main Features?
vQmod can be very useful wherever custom modifications are needed. It also doesn’t make any actual code changes, but only “virtual”. These modifications are then stored in their own, separate files, instead of the main file and are applied “on-the-fly”.
Another good thing about vQmod is that you can apply more than just one modification to the same file without conflict and it is easy enough to update customizations without editing the code itself.
The system also has a wide variety of options for find/replace, error handling, positions, indexing and more and, if there’s an error, it will fail safely back to the source file.
What about OCMOD?
Now let’s take a look at OCMOD.
Just like vQmod, OCMOD is developed for store owners to modify their store by uploading a compressed file that includes PHP, XML and SQL files. In fact, if it looks a lot like vQmod, that is because OCMOD is basically a stripped down version of it.
What are the Differences between the Two?
It look like the main reason OCMOD was created and pushed was because developers at OpenCart, in particular its founder Daniel Kerr, didn’t like vQmod very much.
Here’s something he wrote in a chat group:
“The problem also is vQmod, I just don't like how there are a lot of unnecessary features.”
So, he went out and scaled down vQmod to create a new system which is missing the following attributes: top, bottom, iafter and ibefore, but still has before, after, limit, replace, error, ignoreif, offset and regrex.
What makes matters worse for OpenCart is the fact it’s not compatible with vQmod. Because of this and several other issues, OCMOD never received the welcome its developer expected, with the community often calling “poor man’s vQmod”.