Jump to content

v1.4.0 Import CSV doesn't overwrite existing field data


Recommended Posts

So I have a database of 50 products.

 

All the data looks fine except for the "Short Description" field which contains dummy text.

 

So I re-imported an updated CSV file.

 

- I did NOT choose delete all products.

 

- I chose "ignore this column" for all columns EXCEPT the "name" (which is required)

and the "Short Description" because thats the new data I want.

 

- It appeared to import without errors.

 

But when I examine each product it still the Short Description dummy text.

 

Should I have ALSO selected the ID field (even though it doesnt appear to be a requirement)?

Should I have assigned every column in the imported CSV even though most of the data

is unaffected.

 

Very strange and a little disappointing.

PrestaShop has been a dream to work with so far.

 

Help please !

Link to comment
Share on other sites

Hi Phrasespot!

 

Yes, I am using Force Compile and No Cache in the Preferences.

 

I will try again today using a CSV file that contains ALL the fields and see how it goes.

 

I discovered that if I DONT include the ID field, PrestaShop just assumes that everything must be a NEW product

so I end up with double the number of products in my database.

There should really be a flag or warning about that in the PrestaShop Product Imports procedure.

Link to comment
Share on other sites

* SOLVED *

 

OK, I worked this out.

Really, Prestashop just needs to improve the documentation a little and/or add some flags on the import

products screen to warn Admins about a couple of things.

I think also the CSV import validation process could be improved.

 

1. As noted above, if you are editing existing products you MUST include the ID field.

Really this should be a required field, hence my comment above better validation.

I suppose if you are adding NEW products you might like to leave the ID field blank and let

Prestashop automatically populate the values with the next sequential ID number.

But really, how hard is it to force users to populate that value in the CSV file manually, before importing.

It would save a bit of confusion.

 

2. The other big "gotcha" is that I suppose I assumed that my CSV file really didnt need to include those columns that were irrelevant to my own setup. For example I dont need the "Wholesale price" or "Ecotax" values, so why bother adding them into the CSV file? Well it seems like Prestashop INSISTS on those columns being part of the CSV even if you select "ignore column" later on in the import process. What confused me was that apparently PrestaShop would import my CSV without all the necessary fields just fine but if I edited any data, it wasnt showing up in the database. There should be some validation to make sure that all the required fields are part of the CSV file (even if they are ignored) so that users like me have some clue about what PrestaShop needs to see.

 

3. Another "gotcha" and maybe this is just a fact of life about working with CSV files, is that the first column of your spreadsheet really needs to contain values for every row. If your first column is, say "Active (0/1)" and you choose not to populate that column, Prestashop will import the file, but when you try to match up the data to the PrestaShop fields, everything will look very funky.

In fact it probably wont work at all.

 

4. Importing products for a different language version (I have an English/Japanese store) works fine. Again, just remember to include the ID field, the name field (I think its required) and whatever fields have translations. Your can ignore fields that have say numeric values because they should be reading your default language data anyway. No need to repeat those.

 

5. Features - You should import the feature set in your default language and then go to the Features tab in your back office and translate each feature there.

 

6. Data Sheet - Unfortunately the features are listed on the product data sheet in seemingly random order. If anyone knows a way to override or hack they way that Prestashop displays features on the data tab, please let me know. There must be some kind of array that holds those label/value pairs, in which case I'm sure it's easy in PHP to force a sort order by Ascending or Descending. Not perfect but a lot better than random!

 

7. As I posted elsewhere, it's possible to import anchor tag html and break tag html (and probably more) as part of your CSV file. The important tip is whereever you have a tag attribute (e.g. src= , title= , class= ) you should use single quotes NOT double quotes if your CSV file is set to use double quotes as the text delimiter (e.g. src='../pdf/specs.pdf')

 

Those are my tips anyway. Hope it helps and the PrestaShop team takes some suggestions on board ;)

  • Like 1
Link to comment
Share on other sites

One thing I am still a bit confused about though - bulk importing images.

 

Ideally, I would like to just FTP my images to a folder ( WHICH ONE? Does it matter or is there a particular image directory which I MUST use) and put the image link URL in the appropriate field of the CSV file (again, should it be a URL to the custom directory, or should it be a URL to some required directory that PrestaShop uses for storing thumbnail images it creates internally)?

 

Does PrestaShop "know" enough about the image location to then generate the required thumbnails for

product cover images on the fly? Or do I have to manually create my own thumbnails and then

FTP those to a different folder?

 

Any ideas?

Link to comment
Share on other sites

I use the full path to the images like phrasespot mentioned: http://yourdomain.co...r/image0001.jpg instead of ..//

 

I'm sure you can place your image folder almost anywhere within your prestashop directory.

Someone correct me if I'm wrong, please. Thumbnails automatically generated.

 

There are default "img" folders within your main PS directory and also in your themes folder, too.

I've stored my images in the "upload" folder.

Link to comment
Share on other sites

Thanks fbc !

I used a fully qualified URL path as you suggested (without any containing single or double quotes) and it worked like a champ.

 

I created a new folder in my Prestashop system so the full path for me (which I just copied and pasted into the CSV file) is:

http://www.mydomain.com/importimages/dummyproduct.jpg

 

One final question though,

At some point I am going to move this site from my development server into a production environment i.e. move it onto

a different domain name.

I am wondering whether using a fully qualified URL for the image import process is going to create problems later.

What I mean is, after the images are imported, does PrestaShop really 'care' about the origin of those images?

I suspect that what happens is that PrestaShop generates new images on the fly when we run the CSV import process,

and the source of the images is irrelevant if we later change domain names.

 

Be nice if somebody could confirm that, though.

 

* I guess worse case scenario is that I will need to crack open myPHPadmin and run an SQL update query. *

Link to comment
Share on other sites

If you have the production server already going just add the file structure and place images there, then use that URL. If not then maybe 'find and replace all'. That is a tricky one.

 

Another thing on the images. Why are there multiple URLs for images? In the Sample Products file there are two different images. Is this for the different sizes? Sample... ttp://youdomain.com/img25.jpg, ttp://yourdomain.com/img30.jpg

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

I use the full path to the images like phrasespot mentioned: http://yourdomain.co...r/image0001.jpg instead of ..//

 

I'm sure you can place your image folder almost anywhere within your prestashop directory.

Someone correct me if I'm wrong, please. Thumbnails automatically generated.

 

There are default "img" folders within your main PS directory and also in your themes folder, too.

I've stored my images in the "upload" folder.

 

My store website is www.jewelrybyjamie.com-- so are you saying I need to map the images to "http://jewelrybyjamie.com/imagefolder/image.jpg"?

 

FYI-- Prestashop is installed on an add-on domain, not sure it that makes a difference or not.

 

Is there a way I can copy the exact url I need to use for the csv import? I tried to copy it from Filezilla and it shows up like this:

 

ftp://[email protected]/public_html/jewelrybyjamie/img/p

 

but in the window it shows like this

 

/public_html/jewelrybyjamie/img/p

 

Any help is greatly appreciated! I'm so confused and not sure what else I can do.

Link to comment
Share on other sites

If the tag uses double quotes then wrap it in single quotes.

 

I tried it with single quotes and it doesn't work. I attached csv-- can you take a look and let me know what I might be doing wrong?

The images are uploaded into the upload folder-- but still do not appear.

 

Here is my web address if you can look at it.

 

http://www.jewelrybyjamie.com

 

 

I get a broken link image instead of the pics. There are some pics showing up but they are sample product images. I did upload 3 through BO, thinking I could export the products to see how the url is written in the csv-- but prestashop doesn't have an export option (?) It seems like this should be simple. I'm not an expert but have built websites before. I appreciate your help.

Thanks, Jamie

Link to comment
Share on other sites

I was finally able to upload the images after several attempts. My url was correct -- using the format exactly as shown without quotes

http://www.mysite.com/upload/image.JPG

 

I can only guess that I had 3 things wrong:

 

1.) My permissions in my upload folder was not set to 777

2.) My permissions in my img folder and the ones inside it were not set to 777

3.) My file extension was not in ALL CAPS-- make sure to write it as exactly as shown = csv import is caps sensitive. (Mine was .JPG)

 

After making these changes, I was able to upload the images.

 

For anyone else having this problem, make sure to delete existing images during your csv import. If you don't, the cover image will remain a grey box with a question mark.

 

I hope this will help!

 

Thanks for all who responded to my posts.

Link to comment
Share on other sites

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...