K
K
kamisarlapsha2019-01-30 18:28:00
opencart
kamisarlapsha, 2019-01-30 18:28:00

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;
  }

In short, the essence is this, I display in the order history ( order_list.tpl ) the last date the order was changed, and next to it is a comment. So that when the manager changes the status of the order, he can enter a comment, for example, "issued". And the client displayed this: issued xx.xx.xxxx
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zoozag, 2019-01-30
@kamisarlapsha

You can get order_history in the controller for each order:

$this->model_account_order->getOrderHistories($result['order_id']);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question