Products Grid: Adding a column 'nb of combinations'

Instructions for adding a column to your Sc interface, indicating the number of variations on your products

Prerequisites

Access the PRO section of the tool to add custom fields:

Ensure you select the right grid : ‘Catalog: Products grids’:

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

What is the field ID?: nb_combinations

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

Table

Another table

Field name

Nb combinations

Type

Just display

From the Advanced Properties panel on the right handside:

- select the menu SQL select and enter:

return ' , (SELECT COUNT(id_product_attribute)
            FROM ' . _DB_PREFIX_ . 'product_attribute 
            WHERE id_product = p.id_product 
            ) as nb_combinations';

Finally, register the configuration :

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.