2
2
20strannik082020-09-23 14:42:33
opencart
20strannik08, 2020-09-23 14:42:33

How to display store id and name in opencart admin order list?

Worth Octstore 2.3. In the admin panel in the list of orders, I need to display the id and name of the store opposite each order. I tried to display the $store_id variable in site.ru/admin/view/template/sale/order_list.tpl, but even swears at an error. As I understand it, it is necessary to prescribe in the controller, but I can not understand where and what.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pashok Doom, 2020-09-23
@20strannik08

\admin\controller\sale\order.php in the getList() function

foreach ($results as $result) {
      $data['orders'][] = array(
        'order_id'      => $result['order_id'],
        'store_id'      => $result['store_id'],
        'customer'      => $result['customer'],
        'status'        => $result['status'],
        'total'         => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']),
        'date_added'    => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
        'date_modified' => date($this->language->get('date_format_short'), strtotime($result['date_modified'])),
        'shipping_code' => $result['shipping_code'],
        'view'          => $this->url->link('sale/order/info', 'token=' . $this->session->data['token'] . '&order_id=' . $result['order_id'] . $url, 'SSL'),
        'edit'          => $this->url->link('sale/order/edit', 'token=' . $this->session->data['token'] . '&order_id=' . $result['order_id'] . $url, 'SSL'),
      );
    }

And in the model admin\model\sale\order.php in the getOrders function
$sql = "SELECT o.order_id, o.store_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.order_status_id = o.order_status_id AND os.language_id = '" . (int)$this->config->get('config_language_id') . "') AS status, o.shipping_code, o.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `" . DB_PREFIX . "order` o";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question