Daniel Patilea Posted June 11, 2015 Posted June 11, 2015 Hello, Does anyone know how can i add an additional tab to the order list in the backend? I want to add a tab with the carrier picked for that order. Is this something that has to do with AdminOrdersController.php file? Here's what i mean: 1 1 Share this post Link to post Share on other sites More sharing options...
NemoPS Posted June 11, 2015 Posted June 11, 2015 Check out my tuthttp://nemops.com/filter-by-country-prestashop-order-list/#.VXlMg_nzrmg 2 1 Share this post Link to post Share on other sites More sharing options...
Daniel Patilea Posted June 11, 2015 Posted June 11, 2015 (edited) Check out my tut http://nemops.com/filter-by-country-prestashop-order-list/#.VXlMg_nzrmg I've tried your tutorial but it replaces all the current tabs and adds another some similar ones but with another design, like the one used ok ps 1.5. Then i added this code for the carrier tab: 'carrier' => array( 'title' => $this->l('Carrier'), 'align' => 'center', 'width' => 45 ), And it throws an error: Bad SQL query Unknown column 'carrier' in 'field list' I guess i should add carrieri to the query in order to work. Can you please help me? Edited June 11, 2015 by iDan (see edit history) 1 Share this post Link to post Share on other sites More sharing options...
NemoPS Posted June 12, 2015 Posted June 12, 2015 That is for 1.5, you need to copy the controller from your own as mentioned Anyway it appears you didn't add anything named carrier to the sql query 1 Share this post Link to post Share on other sites More sharing options...
Daniel Patilea Posted June 12, 2015 Posted June 12, 2015 I've also added this sql query: INNER JOIN `'._DB_PREFIX_.'carrier` carrier ON carrier.id_carrier = a.id_carrier Everything is good now. Thanks for your help Nemo! 2 1 Share this post Link to post Share on other sites More sharing options...
heidardg Posted September 17, 2015 Posted September 17, 2015 I've also added this sql query: INNER JOIN `'._DB_PREFIX_.'carrier` carrier ON carrier.id_carrier = a.id_carrier Everything is good now. Thanks for your help Nemo! HI I changed the code as you mentioned. but it shows the carrier ID , is there a way to show the Carrier Name ? I appreciated if you can help me I already spend 5 hours figuring out but no result. Thanks Share this post Link to post Share on other sites More sharing options...
Daniel Patilea Posted September 17, 2015 Posted September 17, 2015 HI I changed the code as you mentioned. but it shows the carrier ID , is there a way to show the Carrier Name ? I appreciated if you can help me I already spend 5 hours figuring out but no result. Thanks You have to select the name in the query, not the id. Add to the query, where you select the data, the following field: carrier.name and it should work 1 Share this post Link to post Share on other sites More sharing options...
heidardg Posted September 17, 2015 Posted September 17, 2015 (edited) You have to select the name in the query, not the id. Add to the query, where you select the data, the following field: carrier.name and it should work Thank you for your post. I tried that already but then the order page shows no order, all the previuse order are gone. I use the following codes: $this->_select = ' a.id_carrier AS carrier, --///-- INNER JOIN `'._DB_PREFIX_.'carrier` carrier ON carrier.name = a.id_carrier ---///--- 'carrier' => array( 'title' => $this->l('Carrier') ), Edited September 17, 2015 by heidardg (see edit history) 1 Share this post Link to post Share on other sites More sharing options...
Daniel Patilea Posted September 17, 2015 Posted September 17, 2015 Thank you for your post. I tried that already but then the order page shows no order, all the previuse order are gone. I use the following codes: $this->_select = ' a.id_carrier AS carrier, --///-- INNER JOIN `'._DB_PREFIX_.'carrier` carrier ON carrier.name = a.id_carrier ---///--- 'carrier' => array( 'title' => $this->l('Carrier') ), Here's my code: $this->_select = ' a.id_currency, a.id_order AS id_pdf, a.id_carrier, carrier.name as crname, CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`, osl.`name` AS `osname`, os.`color`, IF((SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new, country_lang.name as cname, IF(a.valid, 1, 0) badge_success'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`) INNER JOIN `'._DB_PREFIX_.'address` address ON address.id_address = a.id_address_delivery INNER JOIN `'._DB_PREFIX_.'carrier` carrier ON carrier.id_carrier = a.id_carrier INNER JOIN `'._DB_PREFIX_.'country` country ON address.id_country = country.id_country INNER JOIN `'._DB_PREFIX_.'country_lang` country_lang ON (country.`id_country` = country_lang.`id_country` AND country_lang.`id_lang` = '.(int)$this->context->language->id.') LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`) LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)$this->context->language->id.')'; $this->_orderBy = 'id_order'; $this->_orderWay = 'DESC'; and $this->fields_list = array_merge($this->fields_list, array( 'crname' => array( 'title' => $this->l('Carrier'), 'havingFilter' => false, ), )); 3 1 Share this post Link to post Share on other sites More sharing options...
heidardg Posted September 17, 2015 Posted September 17, 2015 Here's my code: $this->_select = ' a.id_currency, a.id_order AS id_pdf, a.id_carrier, carrier.name as crname, CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`, osl.`name` AS `osname`, os.`color`, IF((SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new, country_lang.name as cname, IF(a.valid, 1, 0) badge_success'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`) INNER JOIN `'._DB_PREFIX_.'address` address ON address.id_address = a.id_address_delivery INNER JOIN `'._DB_PREFIX_.'carrier` carrier ON carrier.id_carrier = a.id_carrier INNER JOIN `'._DB_PREFIX_.'country` country ON address.id_country = country.id_country INNER JOIN `'._DB_PREFIX_.'country_lang` country_lang ON (country.`id_country` = country_lang.`id_country` AND country_lang.`id_lang` = '.(int)$this->context->language->id.') LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`) LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)$this->context->language->id.')'; $this->_orderBy = 'id_order'; $this->_orderWay = 'DESC'; and $this->fields_list = array_merge($this->fields_list, array( 'crname' => array( 'title' => $this->l('Carrier'), 'havingFilter' => false, ), )); Finally I did it,. Thank you so much. could you pls advice how I add the Zip code? 1 Share this post Link to post Share on other sites More sharing options...
sting5 Posted November 3, 2016 Posted November 3, 2016 I know the topic's rather old but... Is there a any way to add a logo instead of the name of the carrier? I would really appreciate that! Share this post Link to post Share on other sites More sharing options...
conhelrad Posted December 17, 2020 Posted December 17, 2020 Great tutorial ! Thanks Share this post Link to post Share on other sites More sharing options...
DARKF3D3 Posted September 8, 2021 Posted September 8, 2021 Does anyone know how to do it on PS1.7.7? Share this post Link to post Share on other sites More sharing options...
Janett Posted September 9, 2021 Posted September 9, 2021 (edited) Here a demo module to add a column with carrier : https://github.com/Matt75/displayordercarrier/releases/latest Edited May 7 by Janett (see edit history) Share this post Link to post Share on other sites More sharing options...
kurisuti Posted September 16, 2021 Posted September 16, 2021 On 9/9/2021 at 10:32 AM, Janett said: Here a demo module to add a column with carrier : https://github.com/Matt75/displayordercarrier/releases/latest I've installed this on my shop (Prestashop 1.7.7.6) and it works great. Thank you! Share this post Link to post Share on other sites More sharing options...
raypenbar Posted May 6 Posted May 6 On 9/9/2021 at 10:32 AM, Janett said: Here a demo module to add a column with carrier : https://github.com/Matt75/displayordercarrier/releases/latest Hello, I'm sorry if the question seems stupid, but how do you install this module ? I tried to install the zip, Presta said it's not a module. I tried in FTP and it broke my modules, error 500. I had to delete it in order to remove the error 500. Share this post Link to post 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