Modification System is one of the default functionality of Opencart which allows you to edit system functionality without directly editing core files. This feature work with creating XML file. Several changes has been done in modification system according to version. The main difference is of vqmod and ocmod. Please click for Opencart-1.5.x.x , Opencart-2.x.x.x and Opencart-3.x.x.x modification system.
How will modification system work in opencart-3.x.x.x?
We will modify left column of admin panel and add some code.
Step 1: Create XML file
First we need to create a file which should have name install.xml
In the upper image some XML tags are being used. Explanation of important tags are given below
- <file>: path attribute is defined for which file you want to override
- <search>: write text for searching in file
- <add>: write editable code inside this tag and set position after or before of searchable data
Now make a zip of install.xml file and name should be like mobikul.ocmod so after creating zip your file name must be mobikul.ocmod.zip
Step 2: Upload
Open your admin panel and go to Extensions->Installer. Click on Upload button as mentioned in below image.
You may have following issues while uploading modification file.
- Invalid file type! : Make sure that you are uploading zip
- Uploaded but no entry under Extensions -> Modifications : Please make sure you made zip of install.xml file
You will get success message similar of upper image. An entry will be present under Extensions -> Modifications as of below image.
If you observe the entry created in upper image and when we prepared xml file so we used some tags like author, version, name and link so you can see these details in upper image.
Step 3: Refresh
When you click on marked button in upper image so refresh method of “admin /controller/marketplace/modification.php” file is called through AJAX and data will be added into duplicate file. This duplicate file will be created under DIR_MODIFICATION/admin/controller/common/column_left.php path. You must know DIR_MODIFICATION is defined into config.php file. In the below image, you can see Mobikul menu has been added.
If Mobikul menu is not added or duplicate file not present under modification so click on log as marked on upper image and find mod name of uploaded XML. In our case mod name is Mobikul and code has been added. If you are getting NOT FOUND – OPERATIONS ABORTED! as marked in below image so text under <search> tag is not present in core file so try to search that text which is present inside core file.
You can go to this path DIR_MODIFICATION/admin/controller/common/column_left.php and check added code. Please see below image.
How will modification system work in opencart-2.x.x.x?
There are minor changes in this version so we will modify same file as did in Opencart-3.x.x.x
Step 1: Create XML file
First we need to create a file which should have name mobikul.ocmod.xml and use the content of Opencart-3.x.x.x . Please click here to get XML content.
Step 2: Upload
Open your admin panel and go to Extensions->Extension Installer. Click on Upload button as mentioned in below image.
You will get success message similar of this image. An entry will be present under Extensions -> Modifications as of this image.
Step 3: Refresh
Please click here to follow step 3 . We modified column_left.php in version 3.x.x.x but in version 2.0.x.x, this file renamed to menu.php so please take care of it.
How will modification system work in opencart-1.5.x.x?
If you have not installed Vqmod on your store so just click here . We will modify left menu of admin panel and add some code.
Step 1: Create XML file
First we need to create a file which should have name mobikul_vqmod.xml and content of this file will be
Mostly tags are similar from ocmod in upper image.
Step 2: Upload
Now upload this file into vqmod/xml directory.
Step 3: Refresh
After loading page, changes should reflect. In our case Mobikul menu is added as pointed on below image.
Now go to vqmod/vqcache so here you can see some files has been created. In our case we modified admin/controller/common/header.php and admin/view/template/common/header.tpl so new created files are named from their directories.
You have reached at the end of this blog. We hope this blog is useful for you. Please visit our website here
3 comments