Import based on MySQL

  • Posts: 28
  • Thank you received: 0
10 years 1 month ago #205887

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 2.5

Hi,

We have a seperate MySQL database with > 1000 products inside. Now, we would like to update/import changes made in this database into our Hikashop installation.

What would be the best way to accomplish this? Is there an example insert query available to properly populate all the right fields at once? How to insert the correct pricing, link to categories (based on e.g. custom field custom_category).

INSERT INTO jos_hikashop_product
(product_code, product_name, product_description,
product_created, product_type, product_published)
SELECT id, naam, omschrijving, UNIX_TIMESTAMP(), 'main', '1'
FROM `artikelenlijst`
ON DUPLICATE KEY UPDATE
product_code = VALUES(product_code),
product_name = VALUES(product_name),
product_description = VALUES(product_description),

Or is there a better approach?

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

  • Posts: 84233
  • Thank you received: 13673
  • MODERATOR
10 years 1 month ago #205956

Hi,

Having a few queries is the most efficient way, especially if you can write them.
We don't have examples for that however.
prices should be added in the hikashop_price table with the price_product_id containing the id of the product for each price
categories should be added in the hikashop_category table, and the links between products and categories should be added in the hikashop_product_category table.

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

Time to create page: 0.054 seconds
Powered by Kunena Forum