xmlopencartvqmod

Vqmod doesn't change files


after installing vqmod, a create test xml file to change all "a" with "b" in header.twig file. But nothing happens.

I googled this problem but still couldn't solve it. What I did before start this question:

  1. Uploaded last vqmod (2.6.4) to root of the site (Opencart ver 3.0.3.2).
  2. Installed it by running /install/install.php
  3. Did a double check changes in files index.php and admin/index.php (both files contain the changes made by the vqmod)
  4. Made simple xml file "replace-demo.xml" and uploaded it in the xml path.
  5. Cleared the modifications cash and clear THEME CASH on dashboard.
  6. Cleared the vqmod cash
  7. Refresh main page of the site in my browser 8... And no changes.

My simple xml file:

<?xml version="1.0" encoding="UTF-8"?>
<modification>
    <id>Replace a with b</id>
    <version>1.0</version>
    <file name="catalog/view/theme/default/template/common/header.twig">
        <operation info="replace a with b">
            <search position="replace"><![CDATA[
            a
            ]]></search>
            <add><![CDATA[
            b
            ]]></add>
        </operation>
    </file>
</modification>

And:

  1. I have not errors in log folder.
  2. Logging = true in vqmod.php
  3. I see files in vqcache folder
  4. When clearing the vqmod cache, they regularly appear every time the page is refreshed. But my header.twig file is not there. Just such files as "vq2-system_engine_action.php" "vq2-system_engine_loader.php", "vq2-system_library_config.php", "vq2-system_library_language.php", "vq2-system_startup.php".
  5. I don't have any add-ons installed in my Opencart 3.0.3.2 (just new website)

Any ideas where did I go wrong? It's just doesn't work.


Solution

  • You should use OCMOD.

    Your file should be:

    <?xml version="1.0" encoding="UTF-8"?>
    <modification>
        <name>Replace a with b</name>
        <code>Replace-a-with-b</code>
        <version>v1.0</version>
        <author>Author</author>
        <link><![CDATA[Your full link]]></link> 
        <file path="catalog/view/theme/default/template/common/header.twig">
            <operation info="replace a with b">
                <search><![CDATA[a]]></search>
                <add position="replace"><![CDATA[
                b
                ]]></add>
            </operation>
        </file>
    </modification>
    

    File should be zipped and have the name xxxxxxxxxxxxx.ocmod.zip In search tag do not leave spaces. Then you can install it using default OC installer. After you install your ocmod you must refresh modification and clear the cache in your shop admin.