Vlăduț Teodor
Vlăduț Teodor

Reputation: 21

Can't modify twig file with Ocmod - OPENCART

<?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:

Other info: Opencart v. 3.0.3.3 with journal 3

Upvotes: 2

Views: 933

Answers (2)

mudassir kharavala
mudassir kharavala

Reputation: 1

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

Upvotes: 0

focus.style
focus.style

Reputation: 6750

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

Upvotes: 1

Related Questions