Jump to content

Add Custom Column to Admin Product List


Luigi Donato

Recommended Posts

Greetings,
I would need to add a column with customized information in the backoffice product list.

Searching in the forum, the search tool did not give me relevant results, on Google it did, but I'm not sure about the reliability of the information, the points on which everyone seems to agree are that you have to use:
- hookActionAdminProductsListingFieldsModifier
- $params ['sql_select']
- $params ['sql_table']

But I would like to understand better before starting to work on it, the purpose is to display personalized data, collected by this module:

 

Link to comment
Share on other sites

Ok, thank you very much, this module is very useful to me and it is structured in a simple way.

I tried to edit like this and work, thank you!

$params['sql_select']['id_product'] = [
            'table' => 'p',
            'field' => 'id_product',
            'filtering' => ' %s ',
        ];

        $params['sql_select']['manufacturer_name'] = [
            'table' => 'employee_actions',
            'field' => 'employee',
            'filtering' => 'LIKE \'%%%s%%\'',
        ];

        $params['sql_table']['employee_actions'] = [
            'table' => 'employee_actions',
            'join' => 'LEFT JOIN',
            'on' => 'p.`id_product` = employee_actions.`id_product`',
        ];

However if there are more lines, the product is duplicated, tripled, etc. while I would like it to be in a single row and enter the various results in the same cell.

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

On 7/16/2022 at 12:33 PM, Janett said:

Probably because there more than one results on your table employee_actions with theses criteria, so you have to improve it to have only one result to have only one row. 

Yes, that's the problem, I just don't know how to retrieve all the product's rows in a single row, so that I can see all the information in the product row

Link to comment
Share on other sites

  • 2 weeks 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...