I'm working on a modification for Opencart, using OCmod. Initially, I started writing it for Opencart 2 (It's actually done and working). Now, I'm upgrating it for OC3.
Here's a quick example of what's going wrong.
Previously, I wrote this for OC2:
<operation>
<search><![CDATA[
'status' => ($result['status']) ? $this->language->get('text_enabled') : $this->language->get('text_disabled'),
]]></search>
<add position="replace"><![CDATA[
'status' => ($result['status']),
]]></add>
</operation>
The problem is: As of OC3, this part of the code:
'status' => ($result['status']) ...
has been changed to:
'status' => $result['status'] ...
Therefore, the line will not be found, and the replacement will not be made.
For that reason, if I wish to publish my modification for both versions, I'll have to release two different versions of my modification.
I wonder if there's a way of telling OCmod to search for one of the two lines, and then change the one it finds. That way, I could have only one code working for both versions.
I've tried duplicating that piece of code, making it look for both lines, but my modification stops working since one of the lines is not found.
Any ideas on how to go around this?