mk1_salami Posted March 30, 2015 Share Posted March 30, 2015 Hi all, I'd like to display an additional column in the back office 'Product' page. Next to ID, I'd like to display the EAN13 code. The idea being that I can scan an items barcode when I'm in this column and search for it easily. Can someone tell me the necessary code to enter? I believe I need to edit 'Controllers/Admin/AdminProductsController.php' but I'm not sure on the exact code. Link to comment Share on other sites More sharing options...
PascalVG Posted March 30, 2015 Share Posted March 30, 2015 You're right, that is the file that defines the grid. (best is to make an override for easier update-purposes. See developers guide for more info on this (N.B. Sample in doc talks about controllers/front/, but can also be controllers/admin/ of course) ) This is what has to be done: edit/override file: Controllers/Admin/AdminProductsController.php (Make backup of file, just in case) in function: public function __construct() find (and add red code): $this->fields_list = array(); $this->fields_list['id_product'] = array( 'title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs', 'type' => 'int' ); $this->fields_list['ean13'] = array( 'title' => $this->l('EAN13'), 'align' => 'left', ); $this->fields_list['image'] = array( 'title' => $this->l('Image'), 'align' => 'center', 'image' => 'p', 'orderby' => false, 'filter' => false, 'search' => false ); Result: Hope this helps, pascal 2 1 Link to comment Share on other sites More sharing options...
mk1_salami Posted March 30, 2015 Author Share Posted March 30, 2015 Thanks for your help Pascal - it's working. Link to comment Share on other sites More sharing options...
davidezaza Posted May 29, 2019 Share Posted May 29, 2019 (edited) On 3/30/2015 at 7:06 PM, PascalVG said: You're right, that is the file that defines the grid. (best is to make an override for easier update-purposes. See developers guide for more info on this (N.B. Sample in doc talks about controllers/front/, but can also be controllers/admin/ of course) ) This is what has to be done: edit/override file: Controllers/Admin/AdminProductsController.php (Make backup of file, just in case) in function: public function __construct() find (and add red code): $this->fields_list = array(); $this->fields_list['id_product'] = array( 'title' => $this->l('ID'), 'align' => 'center', 'class' => 'fixed-width-xs', 'type' => 'int' ); $this->fields_list['ean13'] = array( 'title' => $this->l('EAN13'), 'align' => 'left', ); $this->fields_list['image'] = array( 'title' => $this->l('Image'), 'align' => 'center', 'image' => 'p', 'orderby' => false, 'filter' => false, 'search' => false ); Result: Hope this helps, pascal Hello, I tryed to do it but on my prestashop 1.6.1 it doesn't work (see attached file to understand) (I replace on ftp file the original back up file, but now also it doesn't work... Can you help me please? Davide Edited May 29, 2019 by davidezaza (see edit history) Link to comment Share on other sites More sharing options...
davidezaza Posted May 29, 2019 Share Posted May 29, 2019 ...solved with easy action: I went to delete the file "class_index.php" in cache folder and it return to work correctly! Link to comment Share on other sites More sharing options...
stech Posted March 19, 2020 Share Posted March 19, 2020 After upload I have this problem, I can't see manifacturer field now in products associations [TECHNICAL ERROR] ajaxProductManufacturers: parsererror If I delete ean13field I haven't this bug. Why? Link to comment Share on other sites More sharing options...
westart3d Posted March 15, 2022 Share Posted March 15, 2022 How to do it in prestashop 1.7? 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