- Posts: 1184
- Thank you received: 13
characteristics saved data in products table
10 years 7 months ago #229584
by verzevoul
characteristics saved data in products table was created by verzevoul
Hi!
We re developing a script to update hikashop products, categories... , from an external prorgam. we are at the point to update values for a product variant.
I remarked in hikashop product table, that the product which is created as variant of another product doesnt have any connection with the characteristic. I mean there is no refference with the characteristic table. How are these connected? How does hikashop know that the specifiq variant is attached with the characteristic with id XXX
Thanks! I m lost
We re developing a script to update hikashop products, categories... , from an external prorgam. we are at the point to update values for a product variant.
I remarked in hikashop product table, that the product which is created as variant of another product doesnt have any connection with the characteristic. I mean there is no refference with the characteristic table. How are these connected? How does hikashop know that the specifiq variant is attached with the characteristic with id XXX
Thanks! I m lost
Please Log in or Create an account to join the conversation.
10 years 7 months ago #229586
by nicolas
Replied by nicolas on topic characteristics saved data in products table
Hi,
It uses the hikashop_variant table. That's the table which links characteristics and characteristics values on one hand, to the product and variants on the other hand.
It uses the hikashop_variant table. That's the table which links characteristics and characteristics values on one hand, to the product and variants on the other hand.
Please Log in or Create an account to join the conversation.
10 years 7 months ago #229830
by verzevoul
Replied by verzevoul on topic characteristics saved data in products table
Ok. I found it but, how (where is hikashop writing) the default variant? I cannot find it.
Please Log in or Create an account to join the conversation.
10 years 7 months ago #229832
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic characteristics saved data in products table
Hi,
In the variant table too.
The variant_characteristic_id can link to characteristics and also the characteristic values (aka: the default value).
Regards,
In the variant table too.
The variant_characteristic_id can link to characteristics and also the characteristic values (aka: the default value).
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
10 years 7 months ago #230030
by verzevoul
Replied by verzevoul on topic characteristics saved data in products table
what do you mean (aka: the default value).?
you have
`variant_characteristic_id` int(10) unsigned NOT NULL,
`variant_product_id` int(10) unsigned NOT NULL,
`ordering` int(10) unsigned NOT NULL DEFAULT '0',
so how hika knows which is the default?
you have
`variant_characteristic_id` int(10) unsigned NOT NULL,
`variant_product_id` int(10) unsigned NOT NULL,
`ordering` int(10) unsigned NOT NULL DEFAULT '0',
so how hika knows which is the default?
Please Log in or Create an account to join the conversation.
10 years 7 months ago #230085
by verzevoul
Replied by verzevoul on topic characteristics saved data in products table
Please can I have a proper answer so I can proceed withe script?
Please Log in or Create an account to join the conversation.
10 years 7 months ago #230090
by nicolas
Replied by nicolas on topic characteristics saved data in products table
Hi,
In that table, for each product and for each characteristic you have:
- one entry linking a value of the characteristic with a variant of the product
- one entry linking the characteristic itself and the main product
- one entry linking the default value of the characteristic with the main product
So by loading all the entries in that table you know which value is the default one for each characteristic of the product and that way, you know which variant is the default one when the values of the variant match with the values of the links of the main product.
In that table, for each product and for each characteristic you have:
- one entry linking a value of the characteristic with a variant of the product
- one entry linking the characteristic itself and the main product
- one entry linking the default value of the characteristic with the main product
So by loading all the entries in that table you know which value is the default one for each characteristic of the product and that way, you know which variant is the default one when the values of the variant match with the values of the links of the main product.
The following user(s) said Thank You: verzevoul
Please Log in or Create an account to join the conversation.
Time to create page: 0.239 seconds