Products with variants
|
![]() |
Steps for inserting a product with variants:
The rules are:
- in the codroot field insert the code of the root product
- for every variant value complete the code of variant value (field
codvarX), optionally from tbl_artvar.
If in tbl_artvar there is no record with this codvar, the public area will display the value from codvarX. When inserting the record in tbl_objects, you also have to complete the tbl_objects_lng following the rules described in the module - products.
See also the structure of tbl_objects and check the codroot, codvar1, codvar2, codvar3 fields.
Table tbl_vari -- Variant types
Field name | Field description | Field type | Field size | key | required | default | Observation |
---|---|---|---|---|---|---|---|
codvari | Variant type code | VARCHAR | 50 | yes | yes | ||
code_lng | Language code (e.g.: IT, EN, FR, DE, ES, RO) | CHAR | 2 | yes | yes | IT | ISO code of the language - uppercase [VIEW the table of Language Codes] |
desvari | Type name | VARCHAR | 30 | e.g.: colour | |||
lung | Length of values code | SMALLINT | 2 | yes | 0 | ||
longdesvari5.3 | Long description of variant type | TEXT |
Table tbl_valvari -- Variant values
Field name | Field description | Field type | Field size | key | required | default | Observation |
---|---|---|---|---|---|---|---|
codvari | Variant type code | VARCHAR | 4 | yes | yes | Linked to codvari from tbl_vari | |
code_lng | Language code (e.g.: IT, EN, FR, DE, ES, RO) | CHAR | 2 | yes | yes | IT | ISO code of the language - uppercase [VIEW the table of Language Codes] |
valvari | Variant value code | VARCHAR | 50 | yes | yes | ||
desvvar | Name of the variant value | VARCHAR | 40 | e.g.: red, blue | |||
filevar | File or colour of the variant value | VARCHAR | 50 | could be the name of an image (myImg.gif) or a colour (#777777) | |||
longdesvvar5.3 | Long description of variant value | TEXT |
Table tbl_artroot -- Contains general information about product and the length of variant values per level; also about the management method of prices
Field name | Field description | Field type | Field size | key | required | default | Observation |
---|---|---|---|---|---|---|---|
codroot | Code of the root | VARCHAR | 12 | yes | yes | Linked to codroot from tbl_objects | |
code_lng | Language code (e.g.: IT, EN, FR, DE, ES, RO) | CHAR | 2 | yes | yes | IT | ISO code of the language - uppercase [VIEW the table of Language Codes] |
descr | Description of the root | VARCHAR | 40 | yes | |||
numliv | Number of levels for the root | SMALLINT | 2 | yes | 0 | ||
lungroot | Length of the root | SMALLINT | 2 | ||||
lungvar1 | Length of the code for the level variant 1 | SMALLINT | 2 | yes | 0 | ||
lungvar2 | Length of the code for the level variant 2 | SMALLINT | 2 | yes | 0 | ||
lungvar3 | Length of the code for the level variant 3 | SMALLINT | 2 | yes | 0 | ||
prevar1 | Flag for prices administration (one of the values: 'N' - common prices for all variants, 'S' - different prices) | VARCHAR | 1 | yes | N |
Table tbl_artvar -- Contains the values of variant for every codroot and level
Field name | Field description | Field type | Field size | key | required | default | Observation |
---|---|---|---|---|---|---|---|
codroot | Code of the root | VARCHAR | 12 | yes | yes | Linked to codroot from tbl_objects | |
code_lng | Language code (e.g.: IT, EN, FR, DE, ES, RO) | CHAR | 2 | yes | yes | IT | ISO code of the language - uppercase [VIEW the table of Language Codes] |
livello | Variant level | SMALLINT | 2 | yes | yes | 0 | |
codvar | Variant value code | VARCHAR | 50 | yes | yes | linked to codvar1 from tbl_objects if livello = 1; codvar2 for livello=2; codvar3 for livello=3 | |
descr | Variant value description | VARCHAR | 40 | ||||
filevar | Variant file | varchar | 255 | File must be uploaded on the server | |||
price5.3 | Difference of price | double | Used only when option 'Configuratore varianti' is enabled | ||||
defaultInCombo5.3 | Default value selected in combo | char | 1 | Used only when option 'Configuratore varianti' is enabled |
Table tbl_varliv -- Relates the variant level to the type name
Field name | Field description | Field type | Field size | key | required | default | Observation |
---|---|---|---|---|---|---|---|
codroot | Code of the root | VARCHAR | 12 | yes | yes | 0 | Linked to codroot from tbl_objects |
livello | Variant level | SMALLINT | 2 | yes | yes | 1 | |
codvari | Variant type code | VARCHAR | 50 | yes | yes | Linked to codvari from tbl_vari |
Table tbl_ec_varexcluded --Excluded combinations of variants5.3
Observation: Used only when option 'Configuratore varianti' is enabled
Field name | Field description | Field type | Field size | key | required | default | Observation |
---|---|---|---|---|---|---|---|
codroot | Code of the root | VARCHAR | 100 | yes | yes | ||
codvari_1 | First part of the comb. - code of the variant type | VARCHAR | 50 | yes | yes | ||
valvari_1 | First part of the comb. - code of the variant value | VARCHAR | 50 | yes | yes | ||
codvari_2 | Second part of the comb. - code of the variant type | VARCHAR | 50 | yes | yes | ||
valvari_2 | Second part of the comb. - code of the variant value | VARCHAR | 50 | yes | yes |