Skip to content
  • There are no suggestions because the search field is empty.

Apparel Add-on: Relationship between Parent and Sub-Products

In the ProductCart Database, both the parent product and its sub-products are saved to the "products" table.
 
pcProd_Apparel
The value in this field of the "products" table must be 1 for Apparel products and 0 for Sub-Products.
 
pcProd_ParentProd
The relationship between N sub-products and their unique Parent Product is handled by the "pcProd_ParentProd" field in the "products" table. The field holds the unique ID of the parent product. The value is that of the "idproduct" field for the parent product, in the same table.

The Parent Product should always have:
  • pcProd_Apparel = 1
  • pcProd_ParentProd = 0

A sub-product should always have:
  • pcProd_Apparel = 0
  • pcProd_ParentProd = ID of Parent Product
 
Options used
If the product is a sub-product, the option groups (e.g. "Color") and option attributes (e.g. "Red") assigned to it are stored in the "pcprod_Relationship" field. Let's assume that the field contains the string: 6_9_11
  • 6 = ID of the parent product
  • 9 = ID of the first "option group/option attribute" combination (e.g. "color/red"). The id refers to the "idoptoptgrp" field in the "options_optionsGroups" table.
  • 11 = ID of the second "option group/option attribute" combination (e.g. "size/large"). Here too, the id refers to the "idoptoptgrp" field in the "options_optionsGroups" table.