Categories

Modifications

Modifications

OpenCart modification system allows store owners to extend and edit the system functionality without directly editing core files. The modification system works with XML modification files formatted in a specific way. An XML modification files gives information to the system which file should be changed, which code should be changed and what changes to be done to this code.

To see a list of all the modifications applied to your system go to Extension > Modifications

You can apply modifications either by uploading a single modification file or a compressed file containing XML, PHP and SQL scripts. Both of these approaches use the Extension Installer as a way to be imported into an OpenCart system.

Uploading a single modification file

To install a modification first you need to upload it. Go to Extension > Extension Installer and click the upload button.

single file upload

OpenCart modification files follow a strict naming rules. In order for your modification to be accepted by the installer and uploaded to the system it should have a file extension of .ocmod.xml. Here is an example yourmodifcation.ocmod.xml

After clicking upload a popup will open. Locate the modification file on your local drive and click Open

open a file

If the upload is successful, you will receive a green success message.

upload success

To apply the changes characterised by the uploaded modification file navigate to Extension > Modifications and click the refresh button at the upper right corner.

refresh modification

Once the modifications are applied you will receive a confirmation in the toolbar as shown below:

success modification

Uploading a compressed file containing modification files

OpenCart allows users to install third party extension which add new feature or extend the default functionality. These extensions are also uploaded through the Extension Installer. They should also follow the naming rules for opencart modifications with the exception that the file extension is your_modification.ocmod.zip

Compressed ocmod files, unlike single ocmod.xml files are not always modifying the core system files. In those cases the zip contains only dedicated extension files. If the extension which is about to be installed requires a modification of some of the core system files, besides the dedicated extension files, install.xml file containing those changes is added to the zip.

Here is a sample file and its content of compressed file containing an install.xml and install.php files:

comressed file

compressed file content

Here is what those files and folders represent:

  • "upload"
  • - The upload folder contains all of the core files of the extension you are about to install.
  • "install.php - optional"
  • - This is an optional file containing custom php scripts implementing any post-installation logic if needed.
  • "install.xml - optional"
  • - This is the file which describes the changes which your extension will make to the core system files. It also creates a virtual copy of each one of them and performs the described modifications.

Installing an extension containing a modification file

Go to Extension->Extension installer and click upload.

upload comressed file

Select the correct modification file from your local drive and click "Open"

compressed file open

upload success

After you verify that the upload is successful you need to navigate to Extension > Modifications and click the refresh button.

modification refresh

As mentioned above after successfully applying the modification the system will notify you with green success message.

refresh success