Jump to content
thirty bees forum
  • 0

A few things when importing products via CSV


Question

Posted

Hello!

(Bleeding edge, php 8.3)

I noticed a couple of things when I do CSV imports, maybe something to look at when you have the time @datakick:

Firstly when i import a products i get theese type notices in the error log:

image.png.d7e4b8147c3712251fc9772316209b85.png

Secondly, when importing combinations, i get this notice:

image.thumb.png.7388aa2f03db96adef0afa2dbfc826cb.png

And lastly, when I import, only webp images are generated. Consistency check tells me that images registered in the database does not exists and that i should delete them, only .jpg images. When follow the recommendation and delete them in the consistency check interface, the product in the front office no longer shows any images:

image.thumb.png.f4dd5b631b1bffb930168c1fac87c7f6.png

Thanks!

  • Like 1

10 answers to this question

Recommended Posts

  • 0
Posted

Thanks.

1) We know about the the first set of warnings -- this is issue with legacy code, that stored transient information into objects during import. It will take a lot of refactoring to fix this, unfortunately. Currently it's not high on priority list, as it's still just a deprecation warning. This will be issue on php9, tough

2) Tools::getDateFromDateFormat - thanks, fixed in bleeding edge

3) consistency check module -- I haven't updated the module to check for all supported extensions -- do not use this module on bleeding edge yet

  • Like 1
  • Thanks 1
  • 0
Posted

Is there any way to tell TB that when there is no value in CSV then don't change existing value ? I need make some changes and I couldn't think another way to make and import only changes. But in this case it deletes all values that ae not given and replaces these with nothing.

  • 0
Posted

I assume you have a csv column that is partially populated and you want to keep the data in your db for  the rows you have no value in the csv? If so currently, no - you can't do this in the importer.

If of course your whole column is empty you can simply not import it but I doubt this is your problem.

Created a new issue to track this: https://github.com/thirtybees/thirtybees/issues/2120

  • 0
Posted

There is nothing between two field separator. So there is no value either. Maybe there is some special symbol or combination that tells TB to not change existing value. Very good solution is when there is extra button in CSV importing setting where You can select what to do in actual case. This can be useful for example changing prices.

  • 0
Posted

Yes, I created a feature proposal. Will update you if I can work out something with Codex. We have to be careful which fields we allow this for.

If the whole column is empty, you can simply not import it. You can keep it in the csv that generates it, but you can skip it in the import template. But of course, if the column is partially populated, this does not work, as the fields that have nothing between the separators will also be overwritten.

  • 0
Posted

I don't get it. What is empty column ? If there is no field separator (originally  it is , ) then how will TB understand what do You need import at all ? Or I understand something wrongly ?

For example this :

ID;Active (0/1);Name *;Categories (x,y,z...);Price tax excluded or Price tax included
1;test;;;

It is 5 values. Given are only two, but TB rewrites all. And if there is no value, then erases existing. 

Does column mean any of these 5 values ? So at the moment column 1 has value 1, column 2 has value test etc ?

  • 0
Posted

I'm giving an example with Excel:

image.png.2773e292613ecb8b185734aaf1d44e7c.png

In this case id 2 and 3 will override the price with 0 and not simply skip the import and leave whatever price there was.
Empty cell = ;;

You are missing one more separator; you are starting with ID, which is empty in the example and you should have it  as 

;1;test;;;


If your example with only 1 row you can set up your import template to ignore those columns:

image.png.659c516b1ea730821320474c0e021195.png

But of course, this does not work in my example above as you won't import any price for 1, 4 and 5.

  • 0
Posted (edited)

Ok. I got it. This "0. Ignore this Column" is exactly what I need. Somehow I have forgotten all this. An there is even way to save what do You need. So there is no need to "play" every time what column You need to ignore.

I use excel to make CSV. This way I can combine names because they vary, depends on functionality. And if there is 10 000+ items there's no way to edit all these by hand. Excel itself can't handle some specific symbols like Greek letters. So there are some formulas in on cell with 60+ variables. Also in my language there are letters that is best to give with CSV. And due to language peculiarity I need comma in description. So field separator is in my case semi-colon and for value separator I need to use this sign - &. Finally it is more confident to use Notepad2 where I can set encoding and line ending. I even don't dream that this is handy, but at least so far this all works for me.

Anyway  Big Thank You, if this is enough

Edited by led24ee
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...