Little Fairy Posted February 3, 2013 Share Posted February 3, 2013 (edited) Please, if someone knows, let me know is it possible to sort products by name on PDF invoices? It would be great if we can sort them by name somehow on PDF Invoices because we prepare orders from that list. Currently, preparing is quite complicated because by default, product are sorted by ID and we have to go back to the one category (one part of our big store ) XY times. I guess I should change the file /classes/Order.php and maybe classes/OrderDetail.php - to add some ORDER by product_name line? Or maybe some file which generate PDF Invoice? Any help will be greatly appreciated. p.s. I use Prestashop version: 1.5.3.1 Edited February 3, 2013 by Little Fairy (see edit history) Link to comment Share on other sites More sharing options...
Little Fairy Posted February 8, 2013 Author Share Posted February 8, 2013 Anyone, please? I guess that all is about a few lines of "Order by..." code but I am just a newbie girl and I don't dare to make a mess with change of important .php files. Link to comment Share on other sites More sharing options...
Yankee Store Posted May 5, 2013 Share Posted May 5, 2013 Anyone have any idea how we can have invoice and shipping document sort products by reference code . very usefull for picking purporses for order picking thank you in advance Link to comment Share on other sites More sharing options...
prestalollo Posted August 20, 2013 Share Posted August 20, 2013 Looking for the same. Found this: http://www.prestashop.com/forums/topic/68926-solvededit-pdf-invoice-sort-orderreference/ Did you get this to work? Link to comment Share on other sites More sharing options...
Sickboards Posted November 22, 2013 Share Posted November 22, 2013 This seem to work, In Classes\Order\OrderInvoice.php line 114-124 change to: public function getProductsDetail() { return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT * FROM `'._DB_PREFIX_.'order_detail` od LEFT JOIN `'._DB_PREFIX_.'product` p ON p.id_product = od.product_id LEFT JOIN `'._DB_PREFIX_.'product_shop` ps ON (ps.id_product = p.id_product AND ps.id_shop = od.id_shop) WHERE od.`id_order` = '.(int)$this->id_order.' AND od.`id_order_invoice` = '.(int)$this->id.' ORDER BY od.product_name'); } Link to comment Share on other sites More sharing options...
Recommended Posts