We'd like to add the 'Default category' in the product grids
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?: default_category
SC creates the field, you now need to populate the grid with:
Field name: Default category
Table: Another table
Type: Just display
In the Advanced Properties panel on the right handside:
- select the menu SQL Select and enter:
return ', dft_cl.name as default_category ';
- select the menu SQL Left join and enter:
return " LEFT JOIN "._DB_PREFIX_."category_lang dft_cl ON (dft_cl.id_category = prs.id_category_default AND dft_cl.id_lang='".(int)$id_lang."')";
Exit the editing window.
The new field is now present in the list of available fields and you can add it to your product grids.