Page 1 of 1

Ocmod including multiple files, one clarification

Posted: Thu Mar 09, 2017 8:12 pm
by nikolakrivokapic
Hi, can you please clarify for me what this line is doing:
<file name="catalog/view/theme/*/template/*/{search}*.tpl">

Ok, I understand it is including all files in directory. But what is {search}, does that mean to Exclude search.tpl file from this modification or contrary to apply modification only on this file and not on others?

Anyhow, how can I exclude one file from modification where it is saying *.tpl ? I want to exclude one particular file from mod. How?
Thanks!

Re: Ocmod including multiple files, one clarification

Posted: Tue Mar 14, 2017 4:47 pm
by Jsf
Hello,
I have a solution for you. Not the best, but working for me.

You can use ignoreif statement:

Code: Select all

<file path="catalog/controller/extension/module/*.php>
	<operation error="skip">
		<search><![CDATA[, $this->config->get('config_tax')]]></search>
		<ignoreif regex="true"><![CDATA[~(ControllerModuleJournal2CustomSections)~]]></ignoreif>
		<add position="replace"><![CDATA[, $this->config->get('config_tax'), true, $result['product_id']]]></add> 
	</operation>
</file>
Every file has a specific phrase so as in my example I do modification for all module file, but exclude CustomSections.php file, because only this file has "ControllerModuleJournal2CustomSections" text.

P.S. You do not need to use regex, but it is good if you want to exclude more than one files. You can use REGEX OR statement ( | )

I hope it will help to you.