I found the right header_php.php file and opened it up. I want to put the tracking number in the "Status History & Comments" table so I found the part where it calls those spots in the database which I think is the bit of code shown below and did my best to mimic it to add the tracking number. In bigger font is what I added
Code:
$statuses_query = "SELECT os.orders_status_name, osh.date_added, osh.comments, osh.tracking_number
FROM " . TABLE_ORDERS_STATUS . " os, " . TABLE_ORDERS_STATUS_HISTORY . " osh
WHERE osh.orders_id = :ordersID
AND osh.orders_status_id = os.orders_status_id
AND os.language_id = :languagesID
AND osh.customer_notified >= 0
ORDER BY osh.date_added";
$statuses_query = $db->bindVars($statuses_query, ':ordersID', $_GET['order_id'], 'integer');
$statuses_query = $db->bindVars($statuses_query, ':languagesID', $_SESSION['languages_id'], 'integer');
$statuses = $db->Execute($statuses_query);
while (!$statuses->EOF) {
$statusArray[] = array('date_added'=>$statuses->fields['date_added'],
'orders_status_name'=>$statuses->fields['orders_status_name'],
'comments'=>$statuses->fields['comments'],
'tracking_number'=>$statuses->fields['tracking_number']);
$statuses->MoveNext();
}
However when I update it the page crashes and it gives me the following error message:
"1054 Unknown column 'osh.tracking_number' in 'field list'
in:
[SELECT os.orders_status_name, osh.date_added, osh.comments, osh.tracking_number FROM orders_status os, orders_status_history osh WHERE osh.orders_id = 10943 AND osh.orders_status_id = os.orders_status_id AND os.language_id = 1 AND osh.customer_notified >= 0 ORDER BY osh.date_added]"
Which is in a way slightly comforting because it makes me feel like I am doing something, yet I am still far from fixing it.
What am I missing? or Do I have too much? Would it be easier to display the tracking number in a different place so that it would be easier to implement? What does the os. or osh. mean? Is this too many questions for one post?
Bookmarks