For some reason, ocmod incorrectly handles opencart 2.3. So here's what I do in install.xml:
<file path="catalog/view/theme/*/template/checkout/shipping_method.tpl"> <operation> <search position="before"><![CDATA[<?php foreach ($shipping_method['quote'] as $quote) { ?>]]></search> <add><![CDATA[ <?php if($shipping_method['code'] == "onedel"):?> <?php echo $onedel_content;?> <?php endif;?> ]]></add> </operation> </file> I specify position before (with after the same result), I end up with my content in the modified file, but the search line is deleted.
Here is the source:
<?php if (!$shipping_method['error']) { ?> <?php foreach ($shipping_method['quote'] as $quote) { ?> <div class="radio"> but after the modification:
<?php if (!$shipping_method['error']) { ?> <?php if($shipping_method['code'] == "onedel"):?> <?php echo $onedel_content;?> <?php endif;?> <div class="radio"> I do not understand why the desired string is deleted. There are also replacements in install.xml with position = "before", everything is ok. On the docks I read about the offset parameter in the add tag, I added it - it did not help. Ideas have ended ... What is the reason for this behavior? There are no errors in the extension-modification logs.