Jump to content

Display additional column (EAN13) in Catalog > Product in Back Office


mk1_salami

Recommended Posts

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

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:
post-455771-0-94434800-1427735140_thumb.png
 
 
 
Hope this helps,
pascal
 
 
 
 
 
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 4 years later...
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:
post-455771-0-94434800-1427735140_thumb.png
 
 
 
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

insert.png

prodotti.png

Edited by davidezaza (see edit history)
Link to comment
Share on other sites

  • 9 months later...
  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...