OCMOD and vQmod are both modification systems for Opencart which allow you to change things without overwriting any core files. For Opencart version older than 2.x, vQmod was the king. With version 2.x Opencart launched it’s own modification system to replace the need for installing a separate extension.
The state Opencart is in right now, you’ll find yourself dealing with both vqmod and ocmod scripts. I know i do. So i have written this neat bash script which allows me to type
ocmod foo to create a file called foo.ocmod.xml with the basic template ocmod. Same for vqmod, type
vqmod bar and it’ll create a file called bar.xml with vqmod tempalte code.
An alternative to this is creating a snippet in your code editor. I prefer the bash way becuase it takes care of creating the file as well.
Here is the bash script. For ease of use i have added these to my
.bash_profile so the commands are available globally.
- Add the code to your
- To create a vQmod file, type
vqmodand provide the name of the script. For example:
vqmod replacewill create replace.xml
- To create a OCMOD file, type
ocmodand provide the name of the script. For example:
ocmod replacewill create replace.ocmod.xml