Make a backup of the followings before doing anything.
In admin/controller/sale/order.php file,
find all instances of:
Code: Select all
if (isset($this->request->get['filter_customer'])) {
$url .= '&filter_customer=' . $this->request->get['filter_customer'];
}
add after each results found:
Code: Select all
if (isset($this->request->get['filter_group_customer'])) {
$url .= '&filter_group_customer=' . $this->request->get['filter_group_customer'];
}
// Update: December 26, 2014
Find all instances of:
Code: Select all
if (isset($this->request->get['filter_customer'])) {
$filter_customer = $this->request->get['filter_customer'];
} else {
$filter_customer = null;
}
add after:
Code: Select all
if (isset($this->request->get['filter_group_customer'])) {
$filter_group_customer = $this->request->get['filter_group_customer'];
} else {
$filter_group_customer = null;
}
// End Of December 26, 2014 Update
Then, find all instances of:
Code: Select all
'filter_customer' => $filter_customer,
add after each results found:
Code: Select all
'filter_group_customer' => $filter_group_customer,
Then, find:
Code: Select all
'customer' => $result['customer'],
add after:
Code: Select all
'group_customer' => $result['group_customer'],
Then, find:
Code: Select all
$this->data['column_customer'] = $this->language->get('column_customer');
add after:
Code: Select all
$this->data['column_group_customer'] = $this->language->get('column_group_customer');
Then, find:
Code: Select all
$this->data['sort_customer'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'] . '&sort=customer' . $url, 'SSL');
add after:
Code: Select all
$this->data['sort_group_customer'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'] . '&sort=group_customer' . $url, 'SSL');
In admin/language/english/sale/order.php file,
find:
Code: Select all
$_['column_customer'] = 'Customer';
add after:
Code: Select all
$_['column_group_customer'] = 'Customer Groups';
In admin/model/sale/order.php file,
find:
add after:
find:
Code: Select all
$sql = "SELECT o.order_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.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `" . DB_PREFIX . "order` o";
replace with:
Code: Select all
$sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, o.customer_group_id AS group_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.total, o.currency_code, o.currency_value, o.date_added, o.date_modified FROM `" . DB_PREFIX . "order` o";
Then, find:
Code: Select all
if (!empty($data['filter_customer'])) {
$sql .= " AND LCASE(CONCAT(o.firstname, ' ', o.lastname)) LIKE '" . $this->db->escape(utf8_strtolower($data['filter_customer'])) . "%'";
}
add after:
Code: Select all
if (isset($data['filter_group_customer']) && !empty($data['filter_group_customer'])) {
$sql .= " AND o.customer_group_id = '" . (int)$data['filter_group_customer'] . "'";
} else {
$sql .= " AND o.customer_group_id > '0'";
}
In admin/view/template/sale/order_list.tpl file,
find:
Code: Select all
<td class="left"><?php if ($sort == 'customer') { ?>
<a href="<?php echo $sort_customer; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_customer; ?></a>
<?php } else { ?>
<a href="<?php echo $sort_customer; ?>"><?php echo $column_customer; ?></a>
<?php } ?></td>
add after:
Code: Select all
<td class="left"><?php if ($sort == 'group_customer') { ?>
<a href="<?php echo $sort_group_customer; ?>" class="<?php echo strtolower($order); ?>"><?php echo $column_group_customer; ?></a>
<?php } else { ?>
<a href="<?php echo $sort_group_customer; ?>"><?php echo $column_group_customer; ?></a>
<?php } ?></td>
Then, find:
Code: Select all
<td><input type="text" name="filter_customer" value="<?php echo $filter_customer; ?>" /></td>
add after:
Code: Select all
<td><input type="text" name="filter_group_customer" value="<?php echo $filter_group_customer; ?>" /></td>
Then, find:
Code: Select all
<td class="left"><?php echo $order['customer']; ?></td>
add after:
Code: Select all
<td class="left"><?php echo $order['group_customer']; ?></td>
Then, find:
Code: Select all
var filter_customer = $('input[name=\'filter_customer\']').attr('value');
if (filter_customer) {
url += '&filter_customer=' + encodeURIComponent(filter_customer);
}
add after:
Code: Select all
var filter_group_customer = $('input[name=\'filter_group_customer\']').attr('value');
if (filter_group_customer) {
url += '&filter_group_customer=' + encodeURIComponent(filter_group_customer);
}
Remember to do a backup of all these files before proceeding. This is a massive request.