levviking Posted March 12, 2014 Share Posted March 12, 2014 Hi, i want to view the carriers in BackOffice -> Orders Tab, without opening the order details. How to add them? In Administration -> Menus -> Orders. But what to write in this field? Link to comment Share on other sites More sharing options...
vekia Posted March 12, 2014 Share Posted March 12, 2014 You will need to override the AdminOrdersController class in order to do this. Try creating a new file, "/override/controllers/admin/AdminOrdersController.php" and paste the following code into it: <?phpclass AdminOrdersController extends AdminOrdersControllerCore { public function __construct() { parent::__construct(); $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'carrier` crr ON (crr.`id_carrier` = a.`id_carrier`)'; $this->_select = 'crr.`name` AS `carrier_name`,'.$this->_select; $this->fields_list['carrier_name'] = array( 'title' => $this->l('Carrier '), 'width' => 100, 'havingFilter' => true, ); } } Reorder the "fields_list" array to position the carrier name in the table. You might have to delete the class index (/cache/class_index.php) to get the override running. 2 2 Link to comment Share on other sites More sharing options...
vekia Posted March 12, 2014 Share Posted March 12, 2014 another modification: http://www.prestashop.com/forums/topic/293176-filter-orders-by-carrier/ 1 Link to comment Share on other sites More sharing options...
cat1999 Posted May 6, 2014 Share Posted May 6, 2014 You will need to override the AdminOrdersController class in order to do this. Try creating a new file, "/override/controllers/admin/AdminOrdersController.php" and paste the following code into it: <?phpclass AdminOrdersController extends AdminOrdersControllerCore { public function __construct() { parent::__construct(); $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'carrier` crr ON (crr.`id_carrier` = a.`id_carrier`)'; $this->_select = 'crr.`name` AS `carrier_name`,'.$this->_select; $this->fields_list['carrier_name'] = array( 'title' => $this->l('Carrier '), 'width' => 100, 'havingFilter' => true, ); } } Reorder the "fields_list" array to position the carrier name in the table. You might have to delete the class index (/cache/class_index.php) to get the override running. Worked like a charm for me! PS 1.6.0.5 Link to comment Share on other sites More sharing options...
nikmagnus Posted July 15, 2015 Share Posted July 15, 2015 Thanks so much for this. I incorporated this into my override. It works well. Many thanks again! Nik Link to comment Share on other sites More sharing options...
ragnabt Posted October 21, 2015 Share Posted October 21, 2015 (edited) Hi I works great, but I dont understand how I can reorder the list, I would like to "remove" new client column and just put the carrier column in there instead. Edited October 21, 2015 by ragnabt (see edit history) Link to comment Share on other sites More sharing options...
sondiva Posted December 9, 2015 Share Posted December 9, 2015 vekia, on 12 Mar 2014 - 3:55 PM, said: Quote You will need to override the AdminOrdersController class in order to do this. Try creating a new file, "/override/controllers/admin/AdminOrdersController.php" and paste the following code into it: <?phpclass AdminOrdersController extends AdminOrdersControllerCore{public function __construct(){parent::__construct();$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'carrier` crr ON (crr.`id_carrier` = a.`id_carrier`)';$this->_select = 'crr.`name` AS `carrier_name`,'.$this->_select;$this->fields_list['carrier_name'] = array('title' => $this->l('Carrier '),'width' => 100,'havingFilter' => true,);}}Reorder the "fields_list" array to position the carrier name in the table.You might have to delete the class index (/cache/class_index.php) to get the override running. Hi Vekia, I need to put carrier selection while generating all the pdf file invoices from/to date in back office so that we can only print the particular invoices as per carrier selection..any advice on that... Link to comment Share on other sites More sharing options...
Zumo Posted February 11, 2016 Share Posted February 11, 2016 It works perfect in 1.6.1.0 version. Thanks! Link to comment Share on other sites More sharing options...
julianbaros Posted January 4, 2018 Share Posted January 4, 2018 Hello, I need help for my BO. I correctly add a new column with the tracking number (cf ModifBO Commande.png). Now I would like to recover the link of the tracking number in the order (cf CommandeNumSuivi) to put it directly in my column. Like that I don't need to go inside each order to see the link of the tracking number. Please help. Link to comment Share on other sites More sharing options...
julianbaros Posted January 31, 2018 Share Posted January 31, 2018 Anyone can help me please ? Link to comment Share on other sites More sharing options...
NBlack Posted July 18, 2018 Share Posted July 18, 2018 It works like a charm @Vekia Link to comment Share on other sites More sharing options...
rachel01 Posted March 6, 2020 Share Posted March 6, 2020 Hi, I've tried but I've this error : Column 'id_carrier' in field list is ambiguous Can you help me ? Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now