Can't modify twig file with Ocmod - OPENCART

876 Views Asked by At
<?xml version="1.0" encoding="utf-8"?>
        <modification>
        <name>Testing</name>
        <code>testing_ocmod</code>
        <version>1.0.0</version>
        <author>Vladut</author>
        <link>https://google.ro</link>
    
        <file path="catalog/view/theme/*/template/common/header.twig">
            <operation>
                <search><![CDATA[</header>]]></search>
                <add position="before"><![CDATA[
                    <script>
                        console.log('testing');
                    </script>
                ]]></add>
            </operation>
        </file>
    
        <file path="catalog/view/theme/*/template/product/product.twig">
            <operation>
                <search><![CDATA[{{ footer }}]]></search>
                <add position="before"><![CDATA[
                    <h1>teeeest</h1>
                ]]></add>
            </operation>
        </file>
    
    </modification>

i have here 2 files. The first file is editable, but the second file is't.

I tried a lot of tricks to solve the issue, but without luck.

Have some a hint for this issue? I don't know why only the first file can be modified and the second one can't be. :(

I already tried:

  • delete cache/modification from storage
  • delete cache from dashboard
  • refresh modifications
  • tried specify the path of file without wildcard.
  • and a lot of tricks with this ocmod.

Other info: Opencart v. 3.0.3.3 with journal 3

2

There are 2 best solutions below

0
On

Journal 3 has it's own cache. Have you tried to refresh it too? On any page of Journal setting.

Although try to see what is in OCMOD log (on Modifications page in admin panel).

Although try to open your desired file catalog/view/theme/*/template/product/product.twig in system/storage/modification and see if any other modification have modified it?

Twig cache cleaning

0
On
<operation>
change to this code and try again
<operation error="skip">