Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

eCommerce Tycoon


You are currently viewing our eCommerce Tycoon as a guest. Please register to participate.
Login



Reply
Importing CSV file into PrestaShop
Old 02-17-2012, 03:03 AM Importing CSV file into PrestaShop
TWD
TWD's Avatar
King Spam Talker

Posts: 1,296
Trades: 0
Following is for Prestashop 1.4.0

Excellent series of YouTube videos posted here:
http://www.youtube.com/user/gpgiuit/videos

Pace is very sloooooow, and the accent a bit hard to pick out at times
but still a good resource.

There might be a way to do this with Excel but I had better luck by downloading and installing Open Office.

The trick is to paste the list of product fields into an Open Office spreadsheet and use the "Paste Special Transpose" function to paste the fields names horizontally as field headers.

Then enter what you want into the fields and export as CSV.
Remember to choose "edit filters" in the export options and set your file encoding type to UTF-8, your seperator to sem-colon [;] and text delimiter to quote marks (").

Then in PrestaShop use the Tools, Import functions to upload your file.
When that succeeds, choose the type of CSV file you are importing (Category or Products would be the most common I guess).

TIP! Remember to "Skip 1" so that the import ignores the first title row otherwise you will just confuse the hell out of PrestaShop.

Also, remember to select "Ignore the column" if the column is blank or you might get some Fatal error. Dont panic if you do.

Importing Features in PrestaShop is a bit non-intuitive but its a breeze when you know what the workflow is. First you need to have your unique Feature description column names. Then in the import process you need to assign each column the field name "Features". THEN and second box will open up allowing you to input the actual Feature name and press OK.

NOTE: I haven't found a way to import attachments associated with products yet (i.e. downloadable PDF files etc). Will update this thread if I find out.
__________________

Please login or register to view this content. Registration is FREE
"Order a PEBBLE Smart Watch for Bluetooth connection to your iPhone or Android" - 100% Waterproof - 7+ days Battery Charge - High Res Outdoor Readable - Vibrating Alert - Incoming Caller ID

Last edited by TWD; 02-17-2012 at 03:04 AM..
TWD is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-20-2012, 08:09 PM Re: Importing CSV file into PrestaShop
TWD
TWD's Avatar
King Spam Talker

Posts: 1,296
Trades: 0
Update:

If you have some images in your Description field, the SRC attribute probably still points to your old domain. In which case you can run the following SQL query on your database through phpMyAdmin (cheers Chris).

Quote:
UPDATE ps_product_lang SET description = REPLACE(description, 'olddomain' , 'newdomain');
Change the values of "olddomain" and "newdomain" above as is appropriate to your situation.
__________________

Please login or register to view this content. Registration is FREE
"Order a PEBBLE Smart Watch for Bluetooth connection to your iPhone or Android" - 100% Waterproof - 7+ days Battery Charge - High Res Outdoor Readable - Vibrating Alert - Incoming Caller ID

Last edited by TWD; 02-20-2012 at 08:10 PM..
TWD is offline
Reply With Quote
View Public Profile
 
Old 02-29-2012, 10:20 PM Re: Importing CSV file into PrestaShop
TWD
TWD's Avatar
King Spam Talker

Posts: 1,296
Trades: 0
* More tips *

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

Please login or register to view this content. Registration is FREE
"Order a PEBBLE Smart Watch for Bluetooth connection to your iPhone or Android" - 100% Waterproof - 7+ days Battery Charge - High Res Outdoor Readable - Vibrating Alert - Incoming Caller ID
TWD is offline
Reply With Quote
View Public Profile
 
Old 03-02-2012, 12:42 PM Re: Importing CSV file into PrestaShop
Junior Talker

Posts: 1
Trades: 0
highly technical
ganyobii is offline
Reply With Quote
View Public Profile
 
Old 03-23-2012, 02:07 AM Re: Importing CSV file into PrestaShop
TWD
TWD's Avatar
King Spam Talker

Posts: 1,296
Trades: 0
In case anyone is having trouble pasting the field headings into a horizontal row with Open Office, the steps are as follows:

1. Copy the list of field headings from the PrestaShop page as per instructions above.
2. Open a new Open Office spreadsheet.
3. Click in cell A1
4. right click "Paste Special" then choose "unformated text"
5. A dialogue window will open. Probably best to choose UTF8 and the correct language option. The other default options should be correct.
6. Click "OK". You will now have a vertical list.
7. Highlight the list and right-click "Cut"
8. Click on cell A1 again.
9. Right-click select "Paste Special". Make sure "Transpose" is checked in the options panel at the bottom of the dialogue screen.
10. Select "OK".
11. You should now have a horizontal list of field headings ready for your CSV file.
__________________

Please login or register to view this content. Registration is FREE
"Order a PEBBLE Smart Watch for Bluetooth connection to your iPhone or Android" - 100% Waterproof - 7+ days Battery Charge - High Res Outdoor Readable - Vibrating Alert - Incoming Caller ID
TWD is offline
Reply With Quote
View Public Profile
 
Old 05-13-2012, 11:36 PM Re: Importing CSV file into PrestaShop
TWD
TWD's Avatar
King Spam Talker

Posts: 1,296
Trades: 0
More tips

1. If you are importing images and some products have existing images which you dont want to duplicate, make sure the "delete existing images" fields in your CSV have a value of "1". I thought I read somewhere that this was the default option but it seems best to explicitly set it anyway.

2. My image import stopped when it got to about 140 images. No error messages. Just an admin screen with the headers and a blank page. It seems like you need to import images in batches of 100 or so :-(
Either that or maybe it was a memory time out issue. It might be possible to jigger with the php.ini file.
__________________

Please login or register to view this content. Registration is FREE
"Order a PEBBLE Smart Watch for Bluetooth connection to your iPhone or Android" - 100% Waterproof - 7+ days Battery Charge - High Res Outdoor Readable - Vibrating Alert - Incoming Caller ID
TWD is offline
Reply With Quote
View Public Profile
 
Old 06-02-2012, 07:12 PM Re: Importing CSV file into PrestaShop
TWD
TWD's Avatar
King Spam Talker

Posts: 1,296
Trades: 0
Solved by increasing my server memory limit to 256MB using php.ini

WIN !

And while you are at it, might as well increase the number of Post Variables if you need to do a lot of back end translation. By default the max_input_vars is probably set to 1000.
My new php.ini file looks like this:
Quote:
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

; max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_execution_time = 600 ; Maximum execution time of each script, in seconds
; max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
max_input_time = 600 ; Maximum amount of time each script may spend parsing request data
; memory_limit = 64M ; Maximum amount of memory a script may consume (16MB)
memory_limit = 256M ; Maximum amount of memory a script may consume (16MB)
max_input_vars = 3000;
suhosin.post.max_vars = 3000;
suhosin.request.max_vars = 3000;
__________________

Please login or register to view this content. Registration is FREE
"Order a PEBBLE Smart Watch for Bluetooth connection to your iPhone or Android" - 100% Waterproof - 7+ days Battery Charge - High Res Outdoor Readable - Vibrating Alert - Incoming Caller ID
TWD is offline
Reply With Quote
View Public Profile
 
Old 07-12-2012, 07:50 PM Re: Importing CSV file into PrestaShop
Novice Talker

Posts: 14
Trades: 0
TWD: "Solved by increasing my server memory limit to 256MB using php.ini"
This worked for me too, good tip.
jim222 is offline
Reply With Quote
View Public Profile Visit jim222's homepage!
 
Reply     « Reply to Importing CSV file into PrestaShop
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.61721 seconds with 11 queries