Modifying OpenCart: vQmod vs OCMOD

Having two or more ways to do something can be useful, but it isn't always the case. When it comes to OpenCart, there are four ways to modify its core functionality: vQmod, OCMOD, Override Engine and Event Handlers. Let’s take a quick 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 available today. If you're using MultiMerch, you probably know that we only use vQmod for OpenCart core modifications.

It's actually quite simple – search/replace code modifications are specified as separate xml files (see the syntax examples here). vQmod then parses the xml files during page load and applies the modifications to the target files. The result is saved as a temporary modified file, which is then loaded by OpenCart instead of the original one.

This means vQmod doesn’t make any direct changes to the actual OpenCart core files. Because of this, the modifications are non-destructive and the original files are left intact – you can always undo the changes by simply removing the xml file.

vQmod lets you apply multiple modifications to same files, making it possible to install multiple vQmod-powered extensions (usually) without conflicts. The system also has a variety of options for finding/replacing code, error handling, positions, indexing and more. If an error occurs, OpenCart will simply fall back to the original source file.

The drawback is that vQmod isn't part of OpenCart – it needs to be installed separately. If you're creating your own vQmod-powered extensions, you'll need to make sure your clients have vQmod installed on their servers. If it's not present, the extension will not work correctly. (The good thing is – the installation process is really simple: upload, run the installer, done)

Finally, even though vQmod was designed to use it with OpenCart, it can also be used separately – there is a standalone version of vQmod available for download that can be integrated into any custom project unrelated to OpenCart.

Is OCMOD a Better Alternative?

If vQmod is so awesome, why would you need something else? Well, the idea was to have something simpler built into OpenCart and available by default. Or, as Daniel Kerr, the main guy behind OpenCart, put it: "The problem also is vQmod, I just don't like how there are a lot of unnecessary features."

In fact, OCMOD is basically a stripped down version of vQmod system built into OpenCart. It works in a similar way – modifications are stored in xml files and uploaded to the store, then parsed and applied to OpenCart core code. Unlike vQmod, OpenCart has a built-in OCMOD modification uploader and manager. In addition to this, OCMOD allows you to specify extra SQL and PHP code to be executed during modification installation in separate install.php and install.sql files.

There are a few drawbacks compared to the original vQmod, though. This includes a few missing advanced search/replacement modifiers such as top, bottom, iafter and ibefore, as well as partial line matching and a few other things. In addition to this, OpenCart's modification cache needs to be refreshed every time there are changes to OCMOD files, which may slow down development, and OCMOD log files aren't as informative as vQmod's.

Because of these differences and the lack of a clear benefit, OCMOD hasn't received wider adoption (with some of the community calling it a “poor man’s vQmod”) and vQmod is still used by many OpenCart developers who are reluctant to spend time and effort converting their mods. (If you feel like converting, however, see a great vQmod to OCMOD conversion guide by an OpenCart developer rph here).

Conclusion

Both vQmod and OCMOD are meant to be used for the same purpose and both have their pros and cons (feel free to check this developer discussion thread on OpenCart forums). The choice is yours, though. We at MultiMerch still use vQmod – mostly because there are quite a bit of modifications in MultiMerch Marketplace. If you're starting something from scratch, you may as well try OCMOD first since it's part of OpenCart. You can always switch later!

vQmod
+ mature, stable and robust system – original version released in 2010
+ clear documentation
+ simple modification syntax and deployment
- not part of OpenCart core – needs to be installed separately

OCMOD
+ part of OpenCart core – no additional installation needed
+ modification installer integrated into OpenCart
+ "execute during installation" scripts
- a few features missing compared to vQmod
- relatively new system with no clear development roadmap

 

About the authorMartin Boze is the Founder of MultiMerch Marketplace. I also love skydiving, motorcycles and space. And other cool things.

15 replies
  1. Ernie
    Ernie says:

    Thanks, what would OC be, after all, without all those, trying so hard, to fill the huge GAP between fine Technology and well done Communication !?

    No even to mention an OC 2 Manual, just about 2 Years after .... , H.K. will be waiting, probably, 'till someone else does the Job, and hopefully for free!
    Good Luck!
    Ernie
    oc IP_CAM

    PS. Interesting Product, you're working on! Never tested it yet, but keeping my exes wide open...

    Reply
  2. Alex
    Alex says:

    As you can see in the picture.
    After the update version.
    Disappeared from Home MultiMerch Marketplace
    If you switch to administrator requests set vqmod
    How to solve a problem?
    Thank you.

    Reply
  3. nikki panno
    nikki panno says:

    Hi,

    On this Template Monster `http://www.templatemonster.com/help/opencart-modification-systems-conflicts-ocmod-vs-vqmod.html#gref`

    , they say that you should never use both OCMOD and vQMOD together. What's your opinion on that ? Did you experience any issues while using both.

    Reply
    • Martin Boze
      Martin Boze says:

      It's not the case with the latest versions of OCMOD and vQmod – they can be used together at the same time with no major issues.

      Reply
      • Monika Choudhary
        Monika Choudhary says:

        OCMOD is better today and need to always think about it. vqmod often causes the issues, ocmod is easy to use. vqmod and ocmod both interferes with each other if same code used in both. So should avoid one.

        Reply
  4. Niopguch
    Niopguch says:

    Dish of fried tomato like all. Guests usually ask guide are surprised talent hostess. Even guys with pleasure eat fried tomato in biscuit. Tomatoes very good combined are combined with many products. Garlic adds sharpness. Cheese brings red crust. Italian herbs turn roasted tomatoes into a dish from a restaurant. Omelette with tomatoes - easy and nutritious dish for breakfast. Make including sandwiches with fried tomatoes.
    Cooking tomatoes simply. For cooking use butter. In olive oil - fewer calories. It is also combined mixed with fried cubes tomato.
    [url=http://stewedtomatoes.top/canned-stewed-tomatoes-recipe-delicious-simplicity]canning stewed tomatoes recipe[/url]

    Reply

Trackbacks & Pingbacks

  1. […] none of them are good enough to drop the others. Modifying OpenCart through vQmod and OCMOD is a dangerous practice of introducing low level code edits, OpenCart's event system has […]

  2. […] also never switched from vQmod to OCMOD. I covered the difference between vQmod and OCMOD in my blog post a while ago – and I still hold the same opinion. In fact, we have our own modification system in […]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.