Product Code Export / Import Issue

  • Posts: 356
  • Thank you received: 7
  • Hikashop Business
3 years 10 months ago #319596

-- HikaShop version -- : 4.3

Hi,

There are a couple of issues.

1) If you have a product code of say 1001.100 when you export the product the product code is truncated to 1001.1 - I had to export direct from the DB to get it to show the correct code.

2) if you import just the product_id and the product_code - no matter what setting you select on import all the product data (title description images etc) are removed - I thought that it should just update the product code? I got around this by using mass action.

Many thanks

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

  • Posts: 81361
  • Thank you received: 13036
  • MODERATOR
3 years 10 months ago #319603

Hi,

Thanks for your feedback.

1. Yes, that's because there is no type on the columns so the system figures what to do as it does the export by analyzing the content. Here, 1001.100 looks like a float to the system so it processes it as a number and thus the zeros are removed.
We'll look at improving this by forcing the type based on the type of the column in the database. That will prevent that issue.

2. That's because of the way the import is done. In order to allow for the import of important mass of data, the system doesn't support updates of the data in the database, it does a "replace". So the data is either added if the element is not there, or updated but at the MySQL level, not at the PHP level (which would require running extra queries to check if the elements are there or not and if there, run one "update" query for each product already there (which would seriously limit the capacity of the system).
So in such cases, using the Mass action import (which first loads the data from the database, and does that check and then saves the elements one by one) is indeed more appropriate although a hell of a lot slower (but you won't see a difference of you have only a couple thousand products (but you'll see if you have tens of thousands or hundred of thousands of products as the mass action will crash while the main import system will work).
Changing that would be difficult. It would basically require changing the way the system works which an ajax process to run the import little by little so that we can perform all the checks in PHP and not rely on the logic in MySQL and save the products one by one and have the import run in several batches one after the other with the browser triggering the next round periodically.
This also causes some problem with the automatic import, run with the cron task since there is no browser to trigger the next round.
So it's a big endeavor to undertake. I think our time will be better spent on other things like an interface to the import system to select which columns of the CSV goes to which column in the database, or some other things we already have on our todo list. So while it would be great, I wouldn't expect this to change before long.

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

Time to create page: 0.057 seconds
Powered by Kunena Forum