To create a support ticket, start a search

Products Grid: Add a field added to ps_product table by the installation of a 3rd party module

Prerequisites:

- Store Commander version 2014-03-12
- SC Grids Editor Pro Add-on - version 1.0
- The field needs to exist in your database (normally created during the module's installation)

 

Target:

We would like to add the field 'Logistician' of the 'Logisticians management module' allowing the selection of logistician in the products grid.

We will then be able to:

- use the filters in the grids to optimize the selection of products
- mass-edit this field using Store Commander's copy/paste option 
- rapidly export the products grid with this field

 

Setup:

To add the field to the list of available fields for your products grids, click on the add.png in the 'Add a field' panel and enter the following information:

What is the field ID?: id_logistician (should be exactly the name as it is in the database).

 

SC creates the field, you now need to populate the grid with:

Field name: Logistician 

Table: product

Refresh combinations: keep 'no'

Type: Multiple choice

 

To display the choice of logisticians, go to the advanced properties panel:

List of choice:

 

 

$sql='SELECT id_logistician,name_logistician FROM ps_logistician ORDER BY name_logistician';
$res=Db::getInstance()->ExecuteS($sql);
$tmparray=array(0=>'NA');
foreach($res AS $row)
   $tmparray[$row['id_logistician']]=$row['name_logistician'];
return $tmparray;

 

 

This code needs to be modified according to your needs.

 

Exit the editing window and add the field to your grids.