To create a support ticket, start a search

Orders Grid: Adding Default Group


We would like to add a column displaying the name of the customers default group


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

What is the field ID?: id_default_group

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

Field name: Default Group
Table: Another table
Type: Just display

From the Advanced Properties panel on the right handside:

- select the menu SQLSelect and enter:

return ' ,c.id_default_group ';

- select the menu PHP Get Row Data and enter:

  $sql = "SELECT
				FROM "._DB_PREFIX_."group_lang gl 
    WHERE gl.id_group = '".(int)$orderrow[$col]."' AND gl.id_lang = '".(int)$id_lang."'";
 $orderrow[$col] = $res;

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