Export and Import CSV doesn't work as intended

  • Posts: 16
  • Thank you received: 1
10 years 7 months ago #187736

-- HikaShop version -- : 2.3.5 Bsuiness
-- Joomla version -- : 3.3.6
-- Browser(s) name and version -- : chrome

Hello,
today i exported the CSV file, but when i imported it, the categories tree wasn't correct and all items were in a random category.
It looks like that category and parent aren't exported or imported correctly... the only way to recover data is restore jom_hikashop database tables.

Last edit: 10 years 7 months ago by auron89.

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 7 months ago #187746

Hi,

It could happen yes. For example, if you have several categories with the same name. The export would export the categories with their names but when you would import the CSV, the import system wouldn't know which category to use if several of them with the same name would be available and would randomly pick one.
The goal of the export/import system is not to export your product data and then import it back in the website.
The goal of the export is to export a close enough representation of your products data so that you can import them on a new website.
The goal of the import is to import new product data that you didn't had so far on your website.
So the export and import work as we intended (as far as I know), but apparently not as you expected it to work.

Could you tell you more about what you're trying to do so that we can tell you how to do it ?

The following user(s) said Thank You: auron89

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

  • Posts: 16
  • Thank you received: 1
10 years 7 months ago #187828

Hello, thanks for your reply. yes i have a lot of categories with the same name!
Since i have tons of items i found easier edit CSV files with Notepad++ (which allow me to do advanced multiple replaces) rather than use the backend. I could use the mass action of course, but for unknown reason it doesn't work with the "product_weight" table. The table i have imported have a weight value with lot of zero 100000.000 (for example). i tried using mass action to remove them... for example if weight is "1000000.000" replace it with "10". but it doesn't work. it can't find the value i'm searching.

Regards the import/export, a solution could be add the CATEGORY ID in the table.

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 7 months ago #187890

Hi,

The category name is used in the export file as the id wouldn't mean anything for a system where you would import the CSV.
Now you can easily change that by editing the file "export" of the view "product" via the menu Display>Views and changing the line:

$categories[] = $this->categories[$category]->category_name;
to:
$categories[] = $this->categories[$category]->category_id;
But the mass actions system would be more appropriate for the example of modification you're describing.
If the mass action doesn't work like you want, it's probably that it is not configured properly. Could you do a screenshot of your mass action ?

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

  • Posts: 16
  • Thank you received: 1
10 years 7 months ago #188006

Hello, i replaced the weight value from a SQL query.

Anyway, the mass action was configured correctly, the problem was that it doesn't recognize the value i was searching for.

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

Time to create page: 0.060 seconds
Powered by Kunena Forum