Adding composer support

First we need to make a modicification to autoload composer in Opencart.

We create a file named composer.ocmod.xml on our desktop computer.
We add the following contents to this file, before saving it:

<?xml version="1.0" encoding="utf-8"?>
<modification>
    <code>AddComposerSupport</code>
    <name>Add Composer Support</name>
    <version>1.0</version>
    <author>J.J. van de Merwe</author>
    <link>http://www.enovision.nl</link>
    <file path="system/startup.php">
        <operation>
            <search position="after">
                <![CDATA[
spl_autoload_extensions('.php');
                ]]>
            </search>
            <add position="insert">
                <![CDATA[
require DIR_SYSTEM . '../vendor/autoload.php';
                ]]>
            </add>
        </operation>
    </file>  
</modification>

Now we install the modification in Opencart by using the menu option:

extension -> extension installer

After the installation, we need to clear the customization cache. To do this we enter the modification just installed.

Now click on the middle icon (save and clear) in the right top of your screen (see image below):

Last update: Tue, 13 Sep 2022 14:32:15