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

Re: Sort Invoice By Model

Posted: Wed Jul 22, 2020 3:42 pm
by SelfSus
Holy Necropost.... but I can't find something newer. :laugh:

I have applied the fix above and it great, using the Category ID as a prefix in the Model number we are able to group all like products together. Significantly speeding up the picking of products.

Is there a way to now group all the items in a single category in Alphabetical order as well. This will help to have a picking run in a single direction instead of hunting back and forth in the category.