Skip to content

Commit f1464af

Browse files
authored
Merge pull request #337 from abhishek-webkul/gli-756
Removed delivery column and added full name to customer column on order list page at back office
2 parents 3ea879a + 53e0144 commit f1464af

File tree

1 file changed

+4
-37
lines changed

1 file changed

+4
-37
lines changed

controllers/admin/AdminOrdersController.php

+4-37
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,13 @@ public function __construct()
6060
(a.total_paid - a.total_paid_real) AS `amount_due`, a.source AS order_source,
6161
a.id_currency,
6262
a.id_order AS id_pdf,
63-
CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`,
64-
osl.`name` AS `osname`,
65-
os.`color`,
63+
CONCAT(c.`firstname`, \' \', c.`lastname`) AS `customer`,
64+
osl.`name` AS `osname`, os.`color`,
6665
IF((SELECT so.id_order FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer AND so.id_order < a.id_order LIMIT 1) > 0, 0, 1) as new,
67-
country_lang.name as cname,
6866
IF(a.valid, 1, 0) badge_success';
6967

7068
$this->_join = '
7169
LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`)
72-
INNER JOIN `'._DB_PREFIX_.'address` address ON address.id_address = a.id_address_delivery
73-
INNER JOIN `'._DB_PREFIX_.'country` country ON address.id_country = country.id_country
74-
INNER JOIN `'._DB_PREFIX_.'country_lang` country_lang ON (country.`id_country` = country_lang.`id_country` AND country_lang.`id_lang` = '.(int) $this->context->language->id.')
7570
LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`)
7671
LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int) $this->context->language->id.')';
7772
$this->_orderBy = 'id_order';
@@ -164,35 +159,7 @@ public function __construct()
164159
'remove_onclick' => true
165160
)
166161
));
167-
168-
if (Country::isCurrentlyUsed('country', true)) {
169-
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
170-
SELECT DISTINCT c.id_country, cl.`name`
171-
FROM `'._DB_PREFIX_.'orders` o
172-
'.Shop::addSqlAssociation('orders', 'o').'
173-
INNER JOIN `'._DB_PREFIX_.'address` a ON a.id_address = o.id_address_delivery
174-
INNER JOIN `'._DB_PREFIX_.'country` c ON a.id_country = c.id_country
175-
INNER JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country` AND cl.`id_lang` = '.(int)$this->context->language->id.')
176-
ORDER BY cl.name ASC');
177-
178-
$country_array = array();
179-
foreach ($result as $row) {
180-
$country_array[$row['id_country']] = $row['name'];
181-
}
182-
183-
$part1 = array_slice($this->fields_list, 0, 3);
184-
$part2 = array_slice($this->fields_list, 3);
185-
$part1['cname'] = array(
186-
'title' => $this->l('Delivery'),
187-
'type' => 'select',
188-
'list' => $country_array,
189-
'filter_key' => 'country!id_country',
190-
'filter_type' => 'int',
191-
'order_key' => 'cname'
192-
);
193-
$this->fields_list = array_merge($part1, $part2);
194-
}
195-
162+
196163
$this->shopLinkType = 'shop';
197164
$this->shopShareDatas = Shop::SHARE_ORDER;
198165

@@ -3504,4 +3471,4 @@ public function changeRoomStatus()
35043471
}
35053472
}
35063473
}
3507-
}
3474+
}

0 commit comments

Comments
 (0)