I am trying to add the store name in the order list on OpenCart. I saw this post and have tried to modify it to show store name but it doesn't work. It just displayed no results, so no orders show now.
Here is my code:
<modification>
<id><![CDATA[Show Store Name]]></id>
<version>1</version>
<vqmver>2.X</vqmver>
<author>author</author>
<file name="admin/view/template/sale/order_list.tpl">
<operation>
<search position="after"><![CDATA[
<a href="<?php echo $sort_order; ?>"><?php echo $column_order_id; ?></a>
]]></search>
<add><![CDATA[
<!-- custom -->
<td class="text-left">
<?php echo $text_store_name; ?></a>
</td>
<!-- custom -->
]]></add>
</operation>
<operation>
<search position="after"><![CDATA[
<td class="text-right"><?php echo $order['order_id']; ?></td>
]]></search>
<add><![CDATA[
<td class="text-left"><?php if(!empty($order['column_store'])){echo "CU".$order['column_store'];} else{echo " ";} ?></td>
]]></add>
</operation>
</file>
</modification>
I suspect the issue you're having is that in 2.3.0.2, the function
getOrders()inadmin/model/sale/order.phpdoes not query*the way thegetOrder()function does. When I added the fieldstore_nameto the$sqlquery ingetOrders(), displaying the store worked.I didn't write an vqMod, I just modified
admin/view/template/sale/order_list.tpl,admin/model/sale/order.php,admin/controller/sale/order.phpas follows:view/template/sale/order_list.tpl: (obviously you should modify the language file instead of hardcoding; this is just a POC)admin/model/sale/order.php:admin/controller/sale/order.php: