Answer the question
In order to leave comments, you need to log in
How to display comment in OpenCart order history?
Hey! How can I get the last order status, or rather a comment from the oc_order_history table.
All information is pulled out in order_info.tpl and then displayed as an array. I also need to display the comment of the last added status in order_list.tpl .
Here is the model for order_info.tpl
public function getOrderHistories($order_id) {
$query = $this->db->query("SELECT date_added, os.name AS status, oh.comment, oh.notify FROM " . DB_PREFIX . "order_history oh LEFT JOIN " . DB_PREFIX . "order_status os ON oh.order_status_id = os.order_status_id WHERE oh.order_id = '" . (int)$order_id . "' AND os.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY oh.date_added");
return $query->rows;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question