Starting from OpenCart version 2 we have this system that enables us to modify a site by uploading a compressed file that contains XML, SQL and PHP files. That system is called OCMOD and it is based upon Qphoria’s vQmod system. Despite different installation procedures, both vQmod and OCMOD are using the same method to make file modifications within OpenCart platform. OCMOD is available within OpenCart starting from version 2.x and can be found in Dashboard under Extensions option.
OCMOD and vQmod are NOT stand-alone plugins but depend on finding lines of code in a source file, making modifications and finally creating a cache file that the system uses instead of the original core file (kind of “Find/Replace” method but not within the core file). OCMOD cache files can be found in the system folder:
OCMOD extensions are installed by using the default Extension Installer, and please bear in mind that vQmod and OCMOD xml files are NOT interchangeable, hence vQmod extensions cannot be installed using the Extension Installer and OCMOD extensions cannot be installed using vQmod.
Important thing to know is that if the core file code has been changed, or if another OCMOD/vQmod extension needs to modify the same line, then it is quite possible that the extension will not work!
If needed an OCMOD extension can be temporarily disabled or permanently deleted with no alterations or changes of any kind being made to the core files.
Installation of OCMOD extension or module is quite simple. Once you download the extension/module that you need (must be compatible with your version of OpenCart and must ends with .ocmod.zip) you upload that ZIP archive via Extension Installer, and click the Refresh button (very important step!) to reload the modification file.
The downloaded ZIP archive should contain a folder named upload which is required though it may be empty. So usually the file structure of OCMOD extension/module includes the following files and folder:
- upload (required folder that may contain no files)
- install.xml (required file that contains modification instructions)
- install.sql (optional file)
- install.php (optional file)
As you already know and probably have experienced so far every system has its ups and downs, so OCMOD has its known issues and errors. So if the searched line of code is not found and replace instruction is not being executed then a “NOT FOUND” error is logged and the modification is skipped or the whole extension gets aborted. Either way the extension or module gets fu**ed up! Error logs come in very handy for that matter and they can be found in Dashboard panel under Extensions ⇒ Modifications ⇒ Log