To create a support ticket, start a search

Orders Grid: adding 'Manufacturer' field


Target

We would like to add a column displaying the Manufacturer associated to products within orders.

We will then be able to:

  • use the filters in the grid to filter products by manufacturer keeping one line per order
  • rapidly export the orders grid with a line including all products associated to a specific manufacturer of that order
Setup

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

What is the field ID?: manufacturer_name

 

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

Field name: Manufacturer
Table: Another table
Type: only display

 

From the Advanced Properties panel on the right handside:

- select the menu SQL Select and enter:

return ' ,manu.name AS manufacturer_name';

 

- select the menu SQL Left Join and enter:

return " LEFT JOIN "._DB_PREFIX_."manufacturer manu ON (manu .id_manufacturer = p.id_manufacturer)";

 

Exit the editing window.

The new field is now present in the list of available fields and you can add it to your Order grids.
 




Related articles