How To Make The Associations In The Database
You can import representing products just like any other ordinary products and after they are imported you can create a script which "links" corresponding representing products together. Our extension doesn't provide any out-of-the-box import script for linking represented products.
Links are stored in EAV format in catalog_product_link
and related tables. Below is demonstration from our demo.
Representing products in Admin Panel look like this:
In database, the information from this grid is stored in several tables. First of all in catalog_product_link
table products IDS of related products are stored:
Columns described:
- product_id – ID of main product
- linked_product_id – ID of representing (child product)
- link_type_id – 6 means "representing product relationship". It is always the same number, most often 6. Exact number can be found in
catalog_product_link_type
table.
Then please check catalog_product_link_attribute
table. You won't need to import anything into it, but there are important IDs of link attributes and in which table attribute is stored:
As you can see 5 attributes are stored for each representing product link:
- m_parts – value from "Parts" column in the Admin Panel grid
- m_unit – value from "Unit of measure" column in the Admin Panel grid
- m_External_id – reserved
- position – value from "Position" column in the Admin Panel grid
- m_pack_qty – value from "Pack Qty" column in the Admin Panel grid
data_type columns states in which table each attribute is stored. You can see that there are 3 additional tables used. Below these tables are listed and data for our sample product is also provided:
1) catalog_product_link_decimal:
2) catalog_product_link_varchar:
3) catalog_product_link_int: