Page 1 of 1

I can't use multi-line search in Opencart 3.0.2.0 ocmod system !!!!

Posted: Thu Dec 21, 2017 12:53 am
by th3d3sign3r
Hi, i am trying to build my first extension for opencart 3.0.2.0 using ocmod.
My problem is that i want to search for this code inside my install.xml file :

Code: Select all

<file path="catalog/view/theme/*/template/common/header.twig">
	<operation>
	<search><![CDATA[
      {% if logged %}
        <a href="{{ account }}">
        <div class="col-sm-2 pull-right txt-left user-account-btn" id="user-account-btn-id">
        <i class="fa fa-user-o"></i><span class="hidden-xs hidden-sm hidden-md">{{ text_account }}</span>
        </div>
        </a>
        {% endif %}
    ]]></search>
	<add position="replace"><![CDATA[
        // MY NEW CODE GOES HERE 
    ]]></add>
	</operation>
    </file>


The problem is that ocmod cant search and find multi lines of code inside the file header.twig
I searched so many hours to find a solution but no luck!!! :( Can someone show me with an example how can i search for mutli lines of code in ocmod xml ??

Thanks in advance

Re: I can't use multi-line search in Opencart 3.0.2.0 ocmod system !!!!

Posted: Thu Dec 21, 2017 2:01 am
by straightlight
Ensure to use the most recent version of VQMod. If the issue still persists, contact qphoria regarding VQMod library issues.

Re: I can't use multi-line search in Opencart 3.0.2.0 ocmod system !!!!

Posted: Thu Dec 21, 2017 4:58 pm
by th3d3sign3r
Thanks for replying, but i m not using vQmod. I m using the Opencart core ocmod.

Re: I can't use multi-line search in Opencart 3.0.2.0 ocmod system !!!!

Posted: Thu Dec 21, 2017 9:34 pm
by straightlight
Sorry, that is correct - you are posting about OCMod. Although, OCMod does not have multi-line research as VQMod already has.

Re: I can't use multi-line search in Opencart 3.0.2.0 ocmod system !!!!

Posted: Fri Dec 22, 2017 3:48 am
by th3d3sign3r
I m building an xml mod that fix the multi-line search for ocmod but works only for add="after" and add="before" operations. I m trying also to fix the add="replace" operation as well but still no luck with it. However i 'll post my work here the next days.
If someone else knows a solution for this issue please post it here.

Re: I can't use multi-line search in Opencart 3.0.2.0 ocmod system !!!!

Posted: Fri Dec 22, 2017 3:59 am
by straightlight
No problem. Although, more information would be needed since this portion:
// MY NEW CODE GOES HERE
in your file doesn't really provide more information at this time.

Re: I can't use multi-line search in Opencart 3.0.2.0 ocmod system !!!!

Posted: Fri Dec 22, 2017 5:20 pm
by th3d3sign3r

Code: Select all

<file path="catalog/view/theme/*/template/common/header.twig">
	<operation>
	<search><![CDATA[
      {% if logged %}
        <a href="{{ account }}">
        <div class="col-sm-2 pull-right txt-left user-account-btn" id="user-account-btn-id">
        <i class="fa fa-user-o"></i><span class="hidden-xs hidden-sm hidden-md">{{ text_account }}</span>
        </div>
        </a>
        {% endif %}
    ]]></search>
	<add position="replace"><![CDATA[
        <div class="col-sm-2 pull-right txt-left user-account-btn" id="user-account-btn-id">
        <i class="fa fa-user-o"></i><span class="hidden-xs hidden-sm hidden-md">{{ text_account }}</span>
        </div>
    ]]></add>
	</operation>
    </file>
This is the complete code i want to use. As you can see i want to use replace operation so i can remove the <a href> tag from the header.twig code

Re: I can't use multi-line search in Opencart 3.0.2.0 ocmod system !!!!

Posted: Fri Dec 22, 2017 6:05 pm
by JNeuhoff
You should consider alternatives. Using a multi-line search is a bad idea to start with in the first place. Both OCmod and VQmod should only be used as a last resort for core file modifications.