My first mod in VQmod for OpenCart 2 is working, but the code is being inserted in the wrong place. I am probably missing something simple but its confusing me greatly. The code should insert inside a <td>
, after the current content & before the closing </td>
. But instead the code is appearing outside the </td>
Here is the mod : Please note the SEARCH finishes with the closing ?>
php tag (& before the closing </td>
in the original code)
<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id>customize orders page</id>
<version>1.0</version>
<vqmver>2.X</vqmver>
<author>PaulR</author>
<file name="admin/view/template/sale/order_list.tpl">
<operation info="add the card/delivery country text">
<search position="after"><![CDATA[<td class="text-left"><?php echo $order['customer']; ?>]]></search>
<add><![CDATA[<?php
$tf_style1=($order['payment_country']==$order['shipping_country']?"font-size: x-small;":"font-size: x-small; color: red;");
echo "<br /><span style=\"".$tf_style1."\">".$order['payment_country']." / ".$order['shipping_country']."</span>";
?>]]></add>
</operation>
</file>
</modification>
The result in the browser is as follows : you can see my content is appearing AFTER the </td>
<td class="text-left">Paul R</td>
<br /><span style="font-size: x-small; color: red;">United Kingdom / United States</span>
Here is the code snippet from the original file:
<td class="text-right"><?php echo $order['order_id']; ?></td>
<td class="text-left"><?php echo $order['customer']; ?></td>
<td class="text-left"><?php echo $order['status']; ?></td>