Page 1 of 1

Sort Invoice By Model

Posted: Sun Aug 28, 2016 8:34 pm
by andyh
Hi, is there a way of getting the invoice printed so it's sorted by Model low to high to make it easier picking products? Thanks

Re: Sort Invoice By Model

Posted: Mon Aug 29, 2016 1:50 am
by AlexDW
In file admin\model\sale\order.php

find sting (into getOrderProducts method)

Code: Select all

$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'");
and replace to

Code: Select all

$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "' ORDER BY model ASC");
after, also recommended to refresh modifications cache

Re: Sort Invoice By Model

Posted: Thu Sep 15, 2016 5:20 am
by anand2064
thanks That works for model. But any idea if we can sort the Invoice by Brand i.e manufacturer_id or manufacturer i did try with the same code but does not work. Can you please help.! Thanks