abahou Posted August 22, 2013 Share Posted August 22, 2013 (edited) Hello, I'm looking for a solution to display the name of the transporter selected by the customer in the orders table of back office for prestashop 1.5.4.0 . like file attached and thank you Edited August 23, 2013 by vekia (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 22, 2013 Share Posted August 22, 2013 you're talking about back office? or about front office? can you clarify it a bit? I mean where exactly? Link to comment Share on other sites More sharing options...
abahou Posted August 22, 2013 Author Share Posted August 22, 2013 i modified the post !! excuse my English Link to comment Share on other sites More sharing options...
jgullstr Posted August 22, 2013 Share Posted August 22, 2013 (edited) 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: <?php class 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. Edited September 7, 2013 by jgullstr As requested by Author, added 'havingFilter' => true, (see edit history) Link to comment Share on other sites More sharing options...
abahou Posted August 22, 2013 Author Share Posted August 22, 2013 thanks jgullstr, it works !! but i don't know how to change the position of the carrier, which file i can used !! Link to comment Share on other sites More sharing options...
jgullstr Posted August 22, 2013 Share Posted August 22, 2013 (edited) Try replacing $this->fields_list['carrier_name'] = array( 'title' => $this->l('Carrier '), 'width' => 100, 'havingFilter' => true, ); with $pos = 3; //Change this to the position you want $this->fields_list = array_slice($this->fields_list, 0, $pos, true) + array( 'carrier_name' => array( 'title' => $this->l('Carrier '), 'width' => 100, 'havingFilter' => true, ) ) + array_slice($this->fields_list, $pos, count($this->fields_list)-$pos, true); I haven't tested this, but if it doesn't work it should give you an idea about what to do. Edited September 7, 2013 by jgullstr As requested by Author, added: 'havingFilter' => true, (see edit history) 2 Link to comment Share on other sites More sharing options...
abahou Posted August 23, 2013 Author Share Posted August 23, 2013 it works, thank you very much jgullstr Link to comment Share on other sites More sharing options...
vekia Posted August 23, 2013 Share Posted August 23, 2013 thanks for brilliant solution im going to mark this thread as [sOLVED] 1 Link to comment Share on other sites More sharing options...
jgullstr Posted September 7, 2013 Share Posted September 7, 2013 Update: In order to be able to filter on the new "Carrier" field, you will have to add the 'havingFilter' => true, value to the array (See updated previous posts) 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