Daniel Patilea Posted June 11, 2015 Share 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 Link to comment Share on other sites More sharing options...
NemoPS Posted June 11, 2015 Share Posted June 11, 2015 Check out my tuthttp://nemops.com/filter-by-country-prestashop-order-list/#.VXlMg_nzrmg 2 1 Link to comment Share on other sites More sharing options...
Daniel Patilea Posted June 11, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
NemoPS Posted June 12, 2015 Share 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 Link to comment Share on other sites More sharing options...
Daniel Patilea Posted June 12, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
heidardg Posted September 17, 2015 Share 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 Link to comment Share on other sites More sharing options...
Daniel Patilea Posted September 17, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
heidardg Posted September 17, 2015 Share 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 Link to comment Share on other sites More sharing options...
Daniel Patilea Posted September 17, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
heidardg Posted September 17, 2015 Share 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 Link to comment Share on other sites More sharing options...
sting5 Posted November 3, 2016 Share 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! Link to comment Share on other sites More sharing options...
conhelrad Posted December 17, 2020 Share Posted December 17, 2020 Great tutorial ! Thanks Link to comment Share on other sites More sharing options...
DARKF3D3 Posted September 8, 2021 Share Posted September 8, 2021 Does anyone know how to do it on PS1.7.7? Link to comment Share on other sites More sharing options...
Janett Posted September 9, 2021 Share 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, 2022 by Janett (see edit history) Link to comment Share on other sites More sharing options...
kurisuti Posted September 16, 2021 Share 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! Link to comment Share on other sites More sharing options...
raypenbar Posted May 6, 2022 Share Posted May 6, 2022 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. Link to comment Share on other sites More sharing options...
Slayem Posted January 9, 2023 Share Posted January 9, 2023 (edited) On 9/9/2021 at 9:32 AM, Janett said: Here a demo module to add a column with carrier : https://github.com/Matt75/displayordercarrier/releases/latest Hello, Thank you for sharing the module. But, the count of ordersList after use the filter of carrier column not change in the table There are 5 orders in my list after filtering by carrier, but the count display 14 items How we can change the count of orders information after using the added filter ? Thanks Edited January 9, 2023 by Slayem (see edit history) 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