Zen Follower
- Join Date:
- Mar 2009
- Location:
- Italy
- Posts:
- 155
- Plugin Contributions:
- 0
How do I add an order field to the admin orders page?
Hi,
I'm trying to add a field to the order table and to show It in the admin order page.
I added the field ORDER_FLAG to the database order table as TINYINT(1) (it should only have two values 1 and 0)
The simpliest way i thought is to add some line to the /admin/orders.php
For sure i need the heading:
around line 845 after the <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>
I added:
<td class="dataTableHeadingContent" align="center"><?php echo TABLE_ORDER_HEADING_FLAG; ?></td>
I also added the define for the TABLE_ORDER_HEADING_FLAG
Around line 969 after <td class="dataTableContent" align="right"><?php echo $orders->fields['orders_status_name']; ?></td>
I would have something like this:
<td class="dataTableContent" align="center"><?php echo ($orders->fields['ORDER_FLAG'] == 1 ? 'x' : ''); ?></td>
The point is to show a "X" after the "Status" column on the admin order page for the orders that have the field ORDER_FLAG set to 1.
The code part where the field is modified and populated is already done and working, my problem is only to shown it in the admin order page.
The edit of /admin/order.php work but it shown nothing, for sure miss a call, any help would be appreciated :smile:
Zencart ver 1.54
PHP 5.3.3
Mysql 5.1.73