Post by olynnow11 » Fri Jan 20, 2017 6:02 pm

Hi,

How can I change the order the comments are showing in the order view page?

Now, the newest comment is shown at the end. I want it to be 1st.

Thanks

Newbie

Posts

Joined
Fri Dec 30, 2016 4:22 am

Post by opencartmart » Fri Jan 20, 2017 10:27 pm

If you mean order history comment, then find the function getOrderHistories() on the file admin/model/sale/order.php and replace following line:

Code: Select all

$query = $this->db->query("SELECT oh.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 ASC LIMIT " . (int)$start . "," . (int)$limit);
by the line

Code: Select all

$query = $this->db->query("SELECT oh.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 DESC LIMIT " . (int)$start . "," . (int)$limit);

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by olynnow11 » Sun Jan 22, 2017 10:47 pm

Thanks opencartmart.

Actually I was talking about the "status" history in My account> Order list>Order view. What the customer is seeing when logging to his account. Do you know how can I change this?

Thanks

Newbie

Posts

Joined
Fri Dec 30, 2016 4:22 am

Post by opencartmart » Mon Jan 23, 2017 5:37 pm

Almost same. Find the function getOrderHistories() on the file catalog/model/account/order.php and replace following line:

Code: Select all

$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");
By the line

Code: Select all

$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 DESC");

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am
Who is online

Users browsing this forum: No registered users and 7 guests