I study php, set the task to expand the hierarchical system consisting of 2 tables "category" ( id , parent_id , name ) and "goods" ( code , name ), Relations in the table "products 2 category" ( id , code ).

It is necessary to expand the system with faceted classification. Each product group (from a hierarchical classifier) ​​is characterized by a set of facets and units of measure for these facets. Can anyone sketch out how these facets will be created or explained?

    1 answer 1

    I would do that

    1) the facets themselves are just reference books, tables with id, name 2) faceted data about goods are tables for many-to-many links, product id fields (code), id facets

    If facets can matter - I don’t know if this happens, just in case, then the table of 2) gets an additional field - value.

    • Thank you, in principle, and assumed that it would be like reference books. I didn’t quite surely understand what you mean by the meanings can be in these facets, as I understand it, for example, from the table goods: copy paper, create a facet where there is columns for example: quality, number of sheets, brand, measurement unit (pack). It is necessary to create a mechanism for adding, editing and removing facets from a group. Products must have an interface to fill in the values ​​of the facets of the group to which they belong. And what will it look like? - Alexandr K
    • It turns out for each group of products you need to make some kind of template that will create a faceted table and give the opportunity to enter certain data? - Alexandr K