opencartopencart-3ocmod

OpenCart 3 Files from ocmod archive not loading


Faced a problem, I can not figure out what I'm doing wrong. OpenCart 3.0.3.2. I expanded the functionality of the store a little. I did all the work in the original files and everything works as I wanted. I wanted to get acquainted with ocmod and I thought to do all the work using a modifier. At the moment, I left all the working files in their places and removed only 1 file along the path admin/controller/extension/module/test.php. If you return it to its place, then the name of my, so to say, module will appear in Extensions-> modules.

What I've done:

Created a zip archive test.ocmod. The archive contains the install.xml file and the upload folder.

In the folder upload/admin/controller/extension/module/ there is a test.php file that I removed. For the test, I want to return it to its place using the "Installer".

In the install.xml file, this is what:

<?xml version="1.0" encoding="UTF-8"?>
<modification>
    <name>Test</name>
    <code>test</code>
    <version>1.0</version>
    <link>test.test</link>
    <author>Test</author>
    <file path="catalog/view/theme/default/template/common/header.twig">
        <operation>
            <search><![CDATA[
            {{ language }}
            ]]></search>
            <add position="after"><![CDATA[
            {{ test }}
            ]]></add>
        </operation>
    </file>  
</modification>

Installation is excellent. an entry appears in Install History. In the modifier and in Developer Settings, I update everything that is.

And here is the problem itself:

There is nothing in the Modification List. In Extensions-> modules - there is nothing. On the system/storage/modification path, in addition to the system folders and the index.html file, there is nothing either.

ocmod.log

2020-03-24 14:05:40 - MOD: Modification Default

FILE: system/engine/action.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 69

FILE: system/engine/loader.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 77
LINE: 151
LINE: 168

FILE: system/library/config.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 59

FILE: system/library/language.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 67
LINE: 73

FILE: system/library/template/template.php
REGEX: ~(require|include)(_once)?\(([^)]+)~
LINE: 18

FILE: system/library/template/twig.php
CODE: $loader = new \Twig_Loader_Filesystem(DIR_TEMPLATE);
LINE: 19
----------------------------------------------------------------

I thought that this was due to the fact that I did not move the storage folder outside the site directory. I just took out this folder, downloaded the archive again, but there is nothing other than the system folders and files in the modification folder.

If you place the modifier file in the System folder, the changes are applied. But I would like to deal with downloading the archive through the installer.

I don’t know what to try. I read that there is a problem with incorrectly configured FTP, on Opencart 2 I saw this tab, but on OpenCart 3 I do not see it. Tell me, please, what am I doing wrong, or what could be the problem?


Solution

  • You can read OCMOD documentation first: https://webocreation.com/blog/ocmod-documentation/ Next, do not leave the free space in search. should be: <search><![CDATA[{{ language }}]]></search>. File for installing via installer should be yourmodule.ocmod.zip inside this file should be install.xml and upload folder. To the upload folder you can place admin and catalog directories with your module files. After you install your module do not forget refrsh modifications and clear cache in admin dashboard blue gear icon in the right upper corner. Thats all...