giwrgos Posted September 21, 2013 Share Posted September 21, 2013 (edited) Hello i would like to add an extra column in Orders table in the back office. I want to add next to the customer the column of the product name. how i can do it? thanks a lot Edited September 21, 2013 by giwrgos (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted September 21, 2013 Share Posted September 21, 2013 and if customer order more than 1 product? Link to comment Share on other sites More sharing options...
Minkiu Posted September 30, 2013 Share Posted September 30, 2013 Hello, I'm looking for the same solution. Regarding vekia question could it "nest" all the items in the order row ? Something like in the attatchment might be possible? Cheers. Link to comment Share on other sites More sharing options...
vekia Posted September 30, 2013 Share Posted September 30, 2013 You need to define new field in AdminOrdersController.php in fieldlist array add: 'products' => array( 'title'=> $this->l('products') ) then, above in $this->_join define LEFT JOIN (three sseparate joins: ps_cart, ps_cart_product, ps_product_lang) and above in $this->_select define select for ps_product_lang.name 1 Link to comment Share on other sites More sharing options...
Minkiu Posted October 1, 2013 Share Posted October 1, 2013 (edited) Hey there, thank you in advance, I'm trying it now, but I'm stuck in the "define the LEFT JOIN" part, would have to look somethin like this: LEFT JOIN '._DB_PREFIX_.'cart LEFT JOIN '._DB_PREFIX_.'cart_product LEFT JOIN '._DB_PREFIX_.'product_lang I'm asking cause others have a parenthesis later, something like: LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`) cheers. Edited October 1, 2013 by Minkiu (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 1, 2013 Share Posted October 1, 2013 ok i analysed code. it will be much better to add order_detail table here is the code: $this->_select = ' od.product_name AS products, a.id_currency, a.id_order AS id_pdf, 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'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order` = a.`id_order`) LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`) LEFT JOIN `'._DB_PREFIX_.'address` addr ON (a.`id_address_delivery` = addr.`id_address`) 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'; 2 Link to comment Share on other sites More sharing options...
Minkiu Posted October 1, 2013 Share Posted October 1, 2013 THANK YOU VERY MUCH :___D And now to loop the loop, what if I wanted to add a Supplier column? _select=' howeversupplierasarecalled AS supplier, // 'LEFT JOIN `'._DB_PREFIX_.'product_supplier` ps ON (a.`id_supplier` = ps.`id_supplier`)'; // 'supplier' => array( 'title'=> $this->l('Supplier')) ?? Thank you again, you are a life saver! Cheers. Link to comment Share on other sites More sharing options...
vekia Posted October 1, 2013 Share Posted October 1, 2013 yea something like that now you can do everything you want ;D 1 Link to comment Share on other sites More sharing options...
Minkiu Posted October 1, 2013 Share Posted October 1, 2013 (edited) Last query :Ei'm a bit lost about the word in the _select part, you used od.product , I guess it's becaouse of od stands for order? You choosed this deliveratedly? Cause i tried adr.adress1 with no luck Cause now i'm trying to fetch the adress of the customer, which I don't know why its not in the customer table itself, and I'm going mad. LEFT JOIN `'._DB_PREFIX_.'address` addr ON (a.`id_address_delivery` = addr.`id_address`) with this i get the id, but how to tell him to fetch the addrs1 column content? something like addr.adress1 AS address should do? Does all this stuff is explained in the documentation (I found something on the left join but it doesn't clarify nothing :/)? Where, cause I can't find a proper explanation; or maybe its more SQL related stuff? Thank you again, So sorry to be bothering again. Edited October 1, 2013 by Minkiu (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 1, 2013 Share Posted October 1, 2013 it isn't described in documentation because this is pure PHP & sql okay so you want to display customer address? here is an example for phone: $this->_select = ' CONCAT(addr.phone, addr.phone_mobile) AS `phone`, od.product_name AS products, a.id_currency, ... and join: LEFT JOIN `'._DB_PREFIX_.'address` addr ON (a.`id_address_delivery` = addr.`id_address`) and array field: 'phone' => array( 'title' => $this->l('Phone') ), So just use different fields in select's CONCAT command that i pasted above and give it name "address" (instead of phone) then somewhere in field list array add 'address' => array( 'title' => $this->l('Addres') ), voila 2 Link to comment Share on other sites More sharing options...
Minkiu Posted October 9, 2013 Share Posted October 9, 2013 Hello again... this is embarrasing :3 Than k you for explanation, i't been very useful :3 Regarding the "show products column" code, Something weird happened, when a person ordered two different items, it duplicated the order 8with same reference, and stuff) but it appears one order for each :/ There must be a "for" or something like that to just keep adding them in the column instead of adding a new order? Thank you again! I shall buy you a beer TT Link to comment Share on other sites More sharing options...
vekia Posted October 9, 2013 Share Posted October 9, 2013 hello thank you for information, im going to test it, so i have to create order with 8 products inside cart ? Link to comment Share on other sites More sharing options...
Minkiu Posted October 9, 2013 Share Posted October 9, 2013 (edited) Well no need to be 8, but in this case were two different products, and one of them had a quantity of 2. If you place an order with 8 different, probably will end up with 8 dupped orders :3 Thanks! Edited October 9, 2013 by Minkiu (see edit history) Link to comment Share on other sites More sharing options...
jojohn Posted December 4, 2013 Share Posted December 4, 2013 Thank you for this trick Link to comment Share on other sites More sharing options...
RecycledTVParts Posted December 12, 2013 Share Posted December 12, 2013 ok i analysed code. it will be much better to add order_detail table here is the code: $this->_select = ' od.product_name AS products, a.id_currency, a.id_order AS id_pdf, 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'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order` = a.`id_order`) LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`) LEFT JOIN `'._DB_PREFIX_.'address` addr ON (a.`id_address_delivery` = addr.`id_address`) 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'; Can I simply copy and paste this into AdminOrdersController.php or, is there something more that I need to do? I am real new at this Any help would be greatly appreciated Thank you much Link to comment Share on other sites More sharing options...
vekia Posted December 12, 2013 Share Posted December 12, 2013 You need to define new field in AdminOrdersController.php in fieldlist array add: 'products' => array( 'title'=> $this->l('products') ) + here is the code: $this->_select = 'od.product_name AS products, a.id_currency, a.id_order AS id_pdf, 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'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order` = a.`id_order`) LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`) LEFT JOIN `'._DB_PREFIX_.'address` addr ON (a.`id_address_delivery` = addr.`id_address`) 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'; Link to comment Share on other sites More sharing options...
RecycledTVParts Posted December 12, 2013 Share Posted December 12, 2013 So, I need to add both ? or, just the bottom code? It is such a pain when we try to determine what a particular customer ordered without opening each order each time Thank you very much again Link to comment Share on other sites More sharing options...
RecycledTVParts Posted December 12, 2013 Share Posted December 12, 2013 So, I can open AdminOrdersController.php with editor and, add the code or? Link to comment Share on other sites More sharing options...
vekia Posted December 12, 2013 Share Posted December 12, 2013 yes, open AdminOrdersController.php and follow instrucitons that i provided in this topic (remember about backup of this file). you have to: in fieldlist array add: 'products' => array( 'title'=> $this->l('products')) and replace code with queries: $this->_select = 'od.product_name AS products, a.id_currency, a.id_order AS id_pdf, 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'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order` = a.`id_order`) LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`)LEFT JOIN `'._DB_PREFIX_.'address` addr ON (a.`id_address_delivery` = addr.`id_address`) 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'; 1 Link to comment Share on other sites More sharing options...
karthiiiiiiiiiik Posted August 13, 2014 Share Posted August 13, 2014 (edited) hi how can i do it for the suppliers, i have followed by adding the supplier in array list i am getting exception [PrestaShopDatabaseException] Unknown column 'supplier' in 'field list' kindly post the full code for adding supplier it would be useful Edited August 13, 2014 by karthiiiiiiiiiik (see edit history) Link to comment Share on other sites More sharing options...
mic1988 Posted August 19, 2015 Share Posted August 19, 2015 Hello i would like to add an extra column in Orders table in the back office. I want to add next to the customer the column of the email and carrier express . how i can do it? thanks a lot Link to comment Share on other sites More sharing options...
democolis Posted December 16, 2015 Share Posted December 16, 2015 How can i get the state name to insert it in the Orders Table? Link to comment Share on other sites More sharing options...
nikmagnus Posted May 6, 2016 Share Posted May 6, 2016 Hi there, Im trying to get the State listed in my Orders list in Back-end. Can anyone help me with what to add to my AdminOrdersController.php override? Thanks in advance nik Link to comment Share on other sites More sharing options...
nomealternativo Posted May 6, 2016 Share Posted May 6, 2016 Hello, I have a similar problem: I would need to add a Vat Number Column in Clients Grid, is it possible? Link to comment Share on other sites More sharing options...
nikmagnus Posted May 6, 2016 Share Posted May 6, 2016 I have done the following: Added: $this->_select = ' addr.address1 AS `address`, and lower down: 'state' => array( 'title' => $this->l('State') ), then later: $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'address` go ON (a.`id_address_delivery` = go.`id_address`) Im really not good at understanding MYSQL and php, and I just cant figure out how to Show the state name rather than just the ID. Any help? 1 Link to comment Share on other sites More sharing options...
nikmagnus Posted May 6, 2016 Share Posted May 6, 2016 OK I got it working for adding a state name. It's actually posted elsewhere, but I will put my explanation here for others who are searching: Im doing the same thing but I got it working.in PS 1.6.1.4 In the AdminOrdersController.php (override it is better!) $this->_select = ' css.name AS `state`, then lower down $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'address` ca ON (a.`id_address_delivery` = ca.`id_address`) LEFT JOIN `'._DB_PREFIX_.'state` css ON (ca.`id_state` = css.`id_state`) finally calling it: 'state' => array( 'title' => $this->l('State') ), If this doesn't make sense, have a look at the AdminOrdersController.php file and make an over-ride that includes. this. also see: https://www.prestashop.com/forums/topic/281786-show-customer-group-on-orders-page-in-backoffice/ Cheers, nik 2 Link to comment Share on other sites More sharing options...
centoasa Posted July 1, 2016 Share Posted July 1, 2016 + sorru, but on 1.6.1.5 release I can't found the array list Link to comment Share on other sites More sharing options...
Hopakus Posted October 11, 2016 Share Posted October 11, 2016 (edited) Vekia you are a genius man. I followed all steps and successed to add the products column, but (there is always a but) what if the product is a personnalized product (with text field). How to show the personnalized text in the products column ? If someone can give me the solution it will be greatly appreciated... ^^ merci. Edited October 11, 2016 by Hopakus (see edit history) Link to comment Share on other sites More sharing options...
Roshan0017 Posted November 11, 2016 Share Posted November 11, 2016 How to add custom button in prestashop orderlist??? @prestashoplegend Link to comment Share on other sites More sharing options...
decoratiunidulci Posted November 21, 2016 Share Posted November 21, 2016 Hello Vekia @Vekia, I have managed a long time ago to have another column in orders page that showed a bubble when there were messages on a specific order. Now I am trying to show the actual messages as "alt" text when hovering that bubble. I have managed to get those messages for every order in the Select part of the sql, but cant put them in the 'alt' part of the vector so they could show up when hovering Any idea ? Link to comment Share on other sites More sharing options...
matscot Posted December 13, 2016 Share Posted December 13, 2016 Hello, me i want to add a column with the total of ecotax of the order and i didn't succeed for now Someone has an idea please ? Link to comment Share on other sites More sharing options...
matscot Posted January 3, 2017 Share Posted January 3, 2017 please i still need help, i didnt succeed yet Link to comment Share on other sites More sharing options...
decome2013 Posted January 26, 2018 Share Posted January 26, 2018 On 13/08/2014 at 2:09 PM, karthiiiiiiiiiik said: hi how can i do it for the suppliers, i have followed by adding the supplier in array list i am getting exception [PrestaShopDatabaseException] Unknown column 'supplier' in 'field list' kindly post the full code for adding supplier it would be useful Hello ! did you find out how to display supplier name ?? Link to comment Share on other sites More sharing options...
Borgas Posted June 7, 2018 Share Posted June 7, 2018 Hello I did manage to insert on list info such as phone ou phone mobile But when i try to put "company" the result is ambiguos I don´t want to enable B2B, because field "company" is beeing used for other info Link to comment Share on other sites More sharing options...
elwood85 Posted February 10, 2019 Share Posted February 10, 2019 (edited) On 12/12/2013 at 4:40 PM, vekia said: yes, open AdminOrdersController.php and follow instrucitons that i provided in this topic (remember about backup of this file). you have to: and replace code with queries: Hi Vekia, could you help me, please? I have used your code explained in this topic, but in Product column appears only one product. I need to views all the products for each order. Thanks a lot. NOTHING AHAHAHAHA I have a mistake. :-D The code is correct, make a new row for each product in the order. Edited February 10, 2019 by elwood85 (see edit history) Link to comment Share on other sites More sharing options...
franky.martin Posted July 12, 2019 Share Posted July 12, 2019 Hi, I would like to add costumer email to order list page. i am trying as @vekia explain in his site; https://mypresta.eu/en/art/developer/tracking-number-orders-list.html Any help please? I work in PS 1.7.4.4 Link to comment Share on other sites More sharing options...
franky.martin Posted August 8, 2019 Share Posted August 8, 2019 En 12/7/2019 a las 6:59 PM, franky.martin dijo: Hi, I would like to add costumer email to order list page. i am trying as @vekia explain in his site; https://mypresta.eu/en/art/developer/tracking-number-orders-list.html Any help please? I work in PS 1.7.4.4 I did it with the next code in AdminOrdersController.ph; $this->fields_list = array( 'id_order' => array( 'title' => $this->trans('ID', array(), 'Admin.Global'), 'align' => 'text-center', 'class' => 'fixed-width-xs' ), 'reference' => array( 'title' => $this->trans('Reference', array(), 'Admin.Global') ), 'new' => array( 'title' => $this->trans('New client', array(), 'Admin.Orderscustomers.Feature'), 'align' => 'text-center', 'type' => 'bool', 'tmpTableFilter' => true, 'orderby' => false, ), /* new code */ 'email' => array( 'title' => $this->trans('Email address', array(), 'Admin.Global') ), 'customer' => array( 'title' => $this->trans('Customer', array(), 'Admin.Global'), 'havingFilter' => true, ), 'products' => array( 'title'=> $this->l('products') ) ); Link to comment Share on other sites More sharing options...
SundaR_devlop Posted September 10, 2019 Share Posted September 10, 2019 We want to add new column in order table like "Product name" of prestashop backoffice. We have tried the above code. But it showing the "500 server error". Can you any one share the code for this problem. Thank you, Regards, Sundaraganapathi M. Link to comment Share on other sites More sharing options...
xaxa Posted October 27, 2019 Share Posted October 27, 2019 On 10/1/2013 at 10:34 AM, vekia said: ok i analysed code. it will be much better to add order_detail table here is the code: $this->_select = ' od.product_name AS products, a.id_currency, a.id_order AS id_pdf, 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'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order` = a.`id_order`) LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`) LEFT JOIN `'._DB_PREFIX_.'address` addr ON (a.`id_address_delivery` = addr.`id_address`) 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'; Hello, there is a probleme with thos solution. Multi rows for a same order appears with multipe produts. Have you an idea to make a list of products for one row order please ? Thank you! Link to comment Share on other sites More sharing options...
uruvaping Posted November 7, 2019 Share Posted November 7, 2019 On 10/27/2019 at 12:42 PM, xaxa said: Hello, there is a probleme with thos solution. Multi rows for a same order appears with multipe produts. Hyou can ave you an idea to make a list of products for one row order please ? Thank you! To archive that, besides the solution above just add this under select> x.products, and this under joints> LEFT JOIN (SELECT s.id_order, GROUP_CONCAT(s.product_name) AS products FROM `'._DB_PREFIX_.'order_detail` s GROUP BY s.id_order) x ON x.id_order = a.id_order Link to comment Share on other sites More sharing options...
avi_t Posted January 12, 2020 Share Posted January 12, 2020 (edited) hii uruvaping do you know haw to add category ,and parent category culumns the same way like products? Edited January 12, 2020 by avi_t (see edit history) Link to comment Share on other sites More sharing options...
Jose Lorenzini Posted August 6, 2020 Share Posted August 6, 2020 (edited) On 5/7/2016 at 1:19 AM, nikmagnus said: this work perfect for me thanks !!! I have done the following: Added: $this->_select = ' addr.address1 AS `address`, and lower down: 'state' => array( 'title' => $this->l('State') ), then later: $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'address` go ON (a.`id_address_delivery` = go.`id_address`) Edited August 6, 2020 by Jose Lorenzini (see edit history) Link to comment Share on other sites More sharing options...
Jose Lorenzini Posted August 6, 2020 Share Posted August 6, 2020 On 5/7/2016 at 1:36 AM, nikmagnus said: hi guys this work perfect for me. OK I got it working for adding a state name. It's actually posted elsewhere, but I will put my explanation here for others who are searching: Im doing the same thing but I got it working.in PS 1.6.1.4 In the AdminOrdersController.php (override it is better!) $this->_select = ' css.name AS `state`, then lower down $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'address` ca ON (a.`id_address_delivery` = ca.`id_address`) LEFT JOIN `'._DB_PREFIX_.'state` css ON (ca.`id_state` = css.`id_state`) finally calling it: 'state' => array( 'title' => $this->l('State') ), If this doesn't make sense, have a look at the AdminOrdersController.php file and make an over-ride that includes. this. also see: https://www.prestashop.com/forums/topic/281786-show-customer-group-on-orders-page-in-backoffice/ Cheers, nik Link to comment Share on other sites More sharing options...
jotas torres Posted December 29, 2020 Share Posted December 29, 2020 (edited) On 11/7/2019 at 9:26 PM, uruvaping said: To archive that, besides the solution above just add this under select> x.products, and this under joints> LEFT JOIN (SELECT s.id_order, GROUP_CONCAT(s.product_name) AS products FROM `'._DB_PREFIX_.'order_detail` s GROUP BY s.id_order) x ON x.id_order = a.id_order How can I do the same for suppliers? I know the way to add the supplier column is this one. $this->_select = ' sup.name AS supplier $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order = a.`id_order`) LEFT JOIN `'. _DB_PREFIX_.'product_supplier` ps ON (ps.`id_product` = od.`product_id`) LEFT JOIN `'._DB_PREFIX_.'supplier` sup ON (sup.`id_supplier` = ps.`id_supplier`) $this->fields_list = array( 'supplier' => array( 'title' => $this->l('Supplier') ), But I don't know how to create a GROUP. Thank You Edited December 29, 2020 by jotas torres (see edit history) Link to comment Share on other sites More sharing options...
jotas torres Posted December 31, 2020 Share Posted December 31, 2020 (edited) On 12/29/2020 at 8:54 PM, jotas torres said: How can I do the same for suppliers? I know the way to add the supplier column is this one. $this->_select = ' sup.name AS supplier $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order = a.`id_order`) LEFT JOIN `'. _DB_PREFIX_.'product_supplier` ps ON (ps.`id_product` = od.`product_id`) LEFT JOIN `'._DB_PREFIX_.'supplier` sup ON (sup.`id_supplier` = ps.`id_supplier`) $this->fields_list = array( 'supplier' => array( 'title' => $this->l('Supplier') ), But I don't know how to create a GROUP. Thank You Finally, it's this one $this->_join = ' LEFT JOIN (SELECT od.id_order, GROUP_CONCAT(sup.name) AS supplier, CONCAT( GROUP_CONCAT(od.product_name) AS products FROM `'._DB_PREFIX_.'order_detail` od LEFT JOIN `'. _DB_PREFIX_.'product_supplier` ps ON (ps.`id_product` = od.`product_id` AND ps.`id_product_attribute` = od.`product_attribute_id`) LEFT JOIN `'._DB_PREFIX_.'supplier` sup ON (sup.`id_supplier` = ps.`id_supplier`) GROUP BY od.id_order) x ON x.id_order = a.id_order $this->fields_list = array( 'products' => array( 'title' => $this->trans('Products', array(), 'Admin.Global'), ), 'supplier' => array( 'title' => $this->trans('Supplier', array(), 'Admin.Global'), ), ); Edited December 31, 2020 by jotas torres (see edit history) Link to comment Share on other sites More sharing options...
goldies Posted January 2, 2021 Share Posted January 2, 2021 (edited) On 12/12/2013 at 4:40 PM, vekia said: yes, open AdminOrdersController.php and follow instrucitons that i provided in this topic (remember about backup of this file). you have to: and replace code with queries: Hello Vekia, good tutorial and it is vorking with PS 1.7.6.9 Orders list and tracking number prestashop back office (mypresta.eu) I actually wanted to insert a Carier instead of a tracking number. I just tried to change the "tracking_number" with "carier" but then I got a blank page in orders. Changed AdminOrdersController.php php with your tutorial is attached. Can you maybe help to get the Carier column in orders page? PS it would be great to have tracking number and Carier... Regards AdminOrdersController.php Edited January 2, 2021 by goldies (see edit history) Link to comment Share on other sites More sharing options...
Artur PL Posted February 8, 2021 Share Posted February 8, 2021 Hi, Is any modyfication was made in Presta 1.7.7.0? I'm trying to use this code with no success... :( I want to add delivery/courier name (show delivery type by for example small delivery logo) such as courier/post/self pickup Link to comment Share on other sites More sharing options...
nikos83 Posted March 12, 2021 Share Posted March 12, 2021 I have noticed that after upgrade from 1.7.5 to 1.7.7.2 all modifications of orders list in admin area not working anymore. Anyone have this working on new version of PS? Link to comment Share on other sites More sharing options...
50l3r Posted May 12, 2021 Share Posted May 12, 2021 AdminOrdersController.php doesnt exist anymore. I have the same problem Link to comment Share on other sites More sharing options...
nikos83 Posted May 13, 2021 Share Posted May 13, 2021 According to the PS docs to get modification on Orders page we need to create module. Anyone have example of module where we can see how does it work? It's based on grid and twig https://devdocs.prestashop.com/1.7/development/components/grid/tutorials/customize-templates/ Link to comment Share on other sites More sharing options...
Janett Posted May 13, 2021 Share Posted May 13, 2021 (edited) 45 minutes ago, nikos83 said: Anyone have example of module where we can see how does it work? I found a module example for OrderGrid here: https://github.com/Matt75/displayordercarrier Edited May 13, 2021 by Janett (see edit history) Link to comment Share on other sites More sharing options...
nikos83 Posted May 13, 2021 Share Posted May 13, 2021 1 hour ago, Janett said: I found a module example for OrderGrid here: https://github.com/Matt75/displayordercarrier Thank you. I've also found something and after little modification see it attached. Go to admin panel modules manager and install this module. After installation on back office catalogue > products you'll see Hello world! hellooo This module has minimal amount of files modified little bit from herehttps://github.com/PrestaShop/PrestaShop/issues/12437 mymodule.zip Link to comment Share on other sites More sharing options...
link2badar Posted March 15, 2022 Share Posted March 15, 2022 https://payzen.io/de-DE/faq/how-to-manage-the-prestashop-order-id.html it's old but may be help anyone. Follow the link and know how to add column in order listing in prestahop 1.7, 1.6 Link to comment Share on other sites More sharing options...
Jose Lorenzini Posted March 16, 2022 Share Posted March 16, 2022 (edited) Legend , i gonna check and i will back to you , thanks and i really appreciated your help!!!!!! pd: I made the wrong post Edited March 16, 2022 by Jose Lorenzini (see edit history) Link to comment Share on other sites More sharing options...
Yulia Vitun Posted October 6, 2022 Share Posted October 6, 2022 (edited) PS 1.7.8.7: - to add new column Invoice number to BO Orders list: in file /src/Core/Grid/Definition/Factory/OrderGridDefinitionFactory.php - to add new column: add this around line 194 ->add((new DataColumn('invoice_number')) ->setName($this->trans('Invoice', [], 'Admin.Global')) ->setOptions([ 'field' => 'invoice_number', ]) ) - to add filter field: add this around line 321 ->add((new IdentifierColumn('invoice_number' )) ->setName($this->trans('Invoice', [], 'Admin.Global')) ->setOptions([ 'identifier_field' => 'invoice_number', 'preview' => $previewColumn, 'clickable' => false, ]) ) To do / not working: - how to sort out in Invoices in Ascending / Descending order? - How to search/ filter for a specific Invoice number? Edited October 6, 2022 by Yulia Vitun (see edit history) 1 Link to comment Share on other sites More sharing options...
link2badar Posted October 7, 2022 Share Posted October 7, 2022 (edited) https://payzen.io/de-DE/faq/how-to-manage-the-prestashop-order-id.html@Yulia Vitun check this link. if you donot get what you want. let me know. for filter, you have to update 2 more lines. visit link and change accordingly. Edited October 7, 2022 by link2badar (see edit history) 1 Link to comment Share on other sites More sharing options...
Yulia Vitun Posted October 12, 2022 Share Posted October 12, 2022 (edited) On 10/7/2022 at 12:20 PM, link2badar said: https://payzen.io/de-DE/faq/how-to-manage-the-prestashop-order-id.html@Yulia Vitun check this link. if you donot get what you want. let me know. for filter, you have to update 2 more lines. visit link and change accordingly. Thank you @link2badar This is exactly what I was looking for! Just to confirm: on PS1.7.8.7 recommended method helps to Sort Out and to Search Invoices in Back office. Edited October 12, 2022 by Yulia Vitun (see edit history) Link to comment Share on other sites More sharing options...
link2badar Posted October 12, 2022 Share Posted October 12, 2022 Pleasure all mine. yes. it will work. 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