Skip to main content

How to import product custom fields from VM?

11 years 10 months ago #188719 by appletree
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 1.5.26
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : Firefox 35.0.1
-- Error-message(debug-mod must be tuned on) -- : no

I am working on a website with Joomla 1.5 and VM 1.1.9 that will be transferred to Joomla 3.3 and Hikashop. I have installed Hikashop on J1.5 and import VM products in Hikashop.
VM has some special custom fields in the product. I have made these fields in Hikashop, so in the database they exist (now). See pictures.

Question: How can I import the VM custom fields in to Hikashop database?
MySQL request – how?
There exits also an jos_hikashop_vm_prod – I think this one is important.

Please Log in or Create an account to join the conversation.

11 years 10 months ago #188746 by Jerome
Hi,

That's right, the best will be to perform a MySQL request directly.
You can use the table "hikashop_vm_prod" which make the link between the "virtuemart_product" and the "hikashop_product".
So you can use an "UPDATE" query to update the "hikashop_product" table from data coming from "vm_product_...." with a inner join on "hikashop_vm_prod".
Something like:
Code:
UPDATE #__hikashop_product AS hkp INNER JOIN #__hikashop_vm_prod AS hkvm ON hkp.product_id = hkvm.hk_id INNER JOIN #__vm_product_type_1 AS vmp ON vmp.product_id = hkvm.vm_id SET hkp.hk_customfieldkey = vmp.vm_customfieldkey
(where you will replace the two fields in the "SET").

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

11 years 10 months ago #189283 by appletree
Thanks Jerome,

I think this is the solution. But my knowledge about MySQL is little, so I have to search someone to get this done. I get errors and that's because I do not exactly know what I am doing.

Please Log in or Create an account to join the conversation.

11 years 10 months ago #189289 by Jerome
Hi,

Just to be sure ; did you replace the "#_" but your database prefix ?
Do you have a special SQL error ?

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

11 years 10 months ago #189360 by appletree
Hello Jerome,
It worked. I have tried replacing #_ for jos_ but I also did not understand completely the rule:
SET
hkp.hk_customfieldkey = vmp.vm_customfieldkey
So I also changed this and the database is complete!

Thanks

Please Log in or Create an account to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum