Discussion and feature requests thread can be found here
vQmod 2.0 released!
It is a great feeling to know that the little ideas I knocked around over the years turned into such a popular modification system. Now, thanks to the great effort and coding skills of JayG, we bring version 2.0 to the community. I am going to retire the vQmod v1.0 thread so I will recap a bit about what vQmod is in this thread for new users, as well as explain any changes for those upgrading from vQmod 1.x to vQmod 2.0.
What is vQmod?
"vQmod™" (aka Virtual Quick Mod) is an override system designed to avoid having to change core files. The concept is quite simple... Instead of making changes to the core files directly, the changes are created as xml search/replace script files. These script files are parsed during page load as each "source" core file is loaded with the "include" or "require" php functions. The source is then patched with the script file changes, and saved to a temp file. That temp file is then substituted for the original during execution. The original source file is never altered. This results in a "virtual" change to the core during execution without any actual modification to the core files.
- Add/Remove a mod by simply adding/removing the associated xml file from the vqmod/xml folder
- OpenCart upgrades will not overwrite your changes or scripts
- Different modifications to the same file can co-exist down to a single character! No other modification system exists with this much granularity
- Powerful yet simple xml formatted syntax
- Can be used to virtually alter any php or tpl file in OpenCart (except the main index.php)
Visit the vQmod home page for more details and examples
How do I install it?
Install Guide (plus video)
How do I use it?
Simple.
1. Download the latest version that has "opencart" in the title
2. Using FTP, upload the "vqmod" folder from the zip to the root of your opencart store.
3. Be sure the vqmod folder and the vqmod/vqcache folders are writable (either 755 or 777). Also be sure index.php and admin/index.php are writable. If not sure which you need, first try 755. If you get errors about permissions, then try 777.
4. Goto http: //www.yoursite.com/vqmod/install.
5. You should get a success message. If not, be sure your store root is writable and try again
6. Load your store homepage
7. Using FTP, verify that there are new "vq" files in the "vqmod/vqcache" folder.
8. If yes, then you are ready to start downloading or creating vQmod scripts, otherwise ask for assistance.
9. The OpenCart development community has made hundreds of vQmod mod scripts in the free and commercial vqmod forums, and almost all developers use vQmod for their other larger modifications that require core alterations.
10. vQmod scripts are simple xml files that you upload into the vqmod/xml folder. If you want to disable a mod, simply remove the script from this folder. After installing a new mod, test it out and verify that no errors are being written to the vqmod/vqmod.log file. If you see errors in that file, be sure you contact the script author for assistance. Do not post script errors here.
What's new in vQmod 2.0?
vQmod 2.0 is a complete rewrite of the code by JayG. The original vQmod 1.x was my original brainchild and was a mess of good and bad ideas mixed into a single file and written as fast as the thoughts came to me. It worked surprisingly well for the shape it was in. JayG took the caterpillar code and turned it into a butterfly It still functions the same but should resolve some small nuances. Performance was never really an issue with v1.0 and v2.0 appears to be just as fast.
How do I upgrade from a previous version of vQmod?
Great news! There are no syntax changes or index.php changes for 2.0. So you should not have to change any of your script files.
1. Back up your /vqmod/xml/ folder locally. This is really just a for good practice, but really the files won't be overwritten anyway so this is optional but recommended just for having a backup.
2. Upload the vqmod/ folder to your store's root path so that it merges with your existing vqmod/ folder via FTP. This should retain your current files, but replace existing vqmod files (not folders). FileZilla is recommended. Be sure you drag-n-drop the new vQmod folder to the scroll bar and NOT ON TOP of the existing vQmod folder as that will put the new one inside of the old one instead of merging them. See the install video above for visual example.
3. Delete the vqmod.log (if it exists) and delete all files in the "vqmod/vqcache" folder on your site. The logs are now written to vqmod/logs on "{day}.log" format to break up the logs a bit.
That's it! The same goes for future versions!
Things to Note:
- While the overall concept of this is virtual modifications, the vQmod installer has to make real changes to the main index.php and admin/index.php files only to initialize the vQmod class. This means if you upgrade to a new version of opencart, you will need to re-run the vQmod install steps above as the index files will likely be overwritten by the upgrade. Be sure that you don't delete the vqmod/install folder after use. There is no danger of keeping it as running the install again will simply note that it is already installed.
- vQmod is limited to php and tpl files. It cannot modify browser loaded files like css and js. However, you can create new css and js files and alter the tpl file to load the newly created files.
- vQmod will create a "vqmod.log" file in the vqmod folder if and only if there are script errors. If you don't see the file, then there are no script errors. If you are having trouble with a script or you see the vqmod.log file, open it up to figure out what the issue is. Keep in mind that it will log an error for every page load so if you don't take care of errors your vqmod.log file can get extremely large very quickly. You can delete this log at any time.. it will recreate itself as needed.
vQmod scripts are only as good as the authors who make them. Once vQmod is installed and working, it is very unlikely that there will be any issues with the vQmod engine itself. If you are having issues with a mod not loading properly it is likely due to a script issue. vQmod has a log file that will record any script errors. It is good practice to always check for this file after installing a new mod. If the file doesn't exist, then there are no script errors. Please do not post script problems in this thread. Script bugs or issues need to be discussed with the author of the individual script. This thread is for discussion of the system, and for bug reporting only. Also be sure the "vqmod_opencart.xml" file is always in the vqmod/xml folder. This is the main script that is required for all others to work. It is included as part of the "opencart version" of the main vQmod install.
If you are getting php errors like "Warning: file_put_contents" or "permissions" then be sure to follow step 3 above.
I upgraded my opencart and vQmod stopped working??
Remember, the vQmod installed must make real file changes to the index.php and admin/index.php for vQmod to be initialized. If you ugpraded OpenCart, then you also replaced the index files with the new ones. Simply rerun the install command: http://mysite.com/vqmod/install/index.php and you should be ready to go again.
BEFORE POSTING A QUESTION BE SURE TO READ THIS ENTIRE POST!