coreygun Posted May 14, 2016 Share Posted May 14, 2016 Hi, I'm trying to import a CSV file of categories for my site, but when uploading I get these errors (screenshot also attached): The category ID cannot be the same as the Root category ID or Home category ID. blah blah blah (ID: 3) cannot be saved The "blah blah blah" is my category name and I get this error for every single category, except for 'ID:1 - Root' and 'ID:2 - Shop'. I have done everything I can find out correctly, and I am also only using the 11 column titles that the import page seems to allow: id, active, name,parent category,root,description,meta title, meta keywords, meta description, seo friendly-url,path to img. I have also tried saving it as UTF-8. If I download my current category list, and reupload that, it doesnt work either because that also has lots of other couln titles which arent allowed! These are the first few lines of my CSV file: id_category;active;name;id_parent;is_root_category;description;meta_title;meta_keywords;meta_description;link_rewrite;image link 1;1;Root;0;0;;;;;; 2;1;Shop;1;1;;;;;; 3;1;Clothing & Accessories;2;0;;;;;; 4;1;Chassis ;2;0;;;;;; 5;1;Handlebar & Foot Controls;2;0;;;;;; 6;1;Electrical ;2;0;;;;;; 7;1;Engines ;2;0;;;;;; My category ID's are all unique, so I don;t know why I get that first error, and the Root and Shop categories which dont seem to get any errors, dont have any different values. Can anybody point me to an actual userguide from Prestashop that works? Thank you. Link to comment Share on other sites More sharing options...
RogueWaveLimited Posted May 14, 2016 Share Posted May 14, 2016 Try the import without the id column. I think PS will assign it's own id's. Link to comment Share on other sites More sharing options...
coreygun Posted May 15, 2016 Author Share Posted May 15, 2016 Try the import without the id column. I think PS will assign it's own id's. Can't do that, because I need to refer to it's parent category by ID, so if I rely on PS doing it itself, I won't know the parent category ID until after I've uploaded it. I have 3 layers of categories. Link to comment Share on other sites More sharing options...
RogueWaveLimited Posted May 16, 2016 Share Posted May 16, 2016 Can't you refer to parent categories by name? E.g. you can have a category name of home/cat1/cat1.1/cat1.2. which will put the categories under the correct parents. Try this on a few test products yourself. Link to comment Share on other sites More sharing options...
coreygun Posted May 20, 2016 Author Share Posted May 20, 2016 Well the column title of that entry is "id_parent". Can I change this to "name_parent" and then use the names rather than ID? Link to comment Share on other sites More sharing options...
coreygun Posted May 31, 2016 Author Share Posted May 31, 2016 Has nobody ever managed to import categories successfully with parent ID's? Link to comment Share on other sites More sharing options...
RogueWaveLimited Posted June 2, 2016 Share Posted June 2, 2016 Cory, What we do when we can't get the info from the manual (frequently the case) is create a small import file with one or two rows and try imports with variations until we find one that works. Link to comment Share on other sites More sharing options...
coreygun Posted June 2, 2016 Author Share Posted June 2, 2016 yeh I understand trial and error, but I thought the whole point of the forum is to save everyone from having to try whats been tried before. Surely somebody has done this before and explain how it is done? Link to comment Share on other sites More sharing options...
coreygun Posted June 21, 2016 Author Share Posted June 21, 2016 I can't believe nobody knows how to import a CSV category list correctly on this entire forum. Link to comment Share on other sites More sharing options...
noodles57 Posted July 7, 2016 Share Posted July 7, 2016 I have the same issue. I give child categories the id of their parent, but get an error "Property Category->is_root_category is not valid" during import. I have been designing databases for years and never have an issue when I create my tables. This is just werid! Link to comment Share on other sites More sharing options...
PaulJANSSENS Posted July 28, 2016 Share Posted July 28, 2016 I have been loosing 2 full days of work trying to import CSV file to categories, customers, products and so on... Nothing is importing. I am receiving plenty of error messages. I have tried averything, with the Column titles and without. With UTF8 or ISO 1, with Mac encoding or Windows. Nothing worked. I have imported my files directly into the appropriate PHP database and it works. It is just to proof that the file is ok for the database. The imports in the PS interface should generate records in other Tables. That's why I don't recommend to import right in the DataBase. I have downloaded the sample csv files of each topics and tried to import them right away without opening it in order to avoid any modification. I didn't work aswell. I simply think that the import tool of PrestaShop is not working. Link to comment Share on other sites More sharing options...
noodles57 Posted July 28, 2016 Share Posted July 28, 2016 The supplied PS .csv files need to be altered. Open them in notepad and add a single quote before ID 'ID and save the file. It will them open in Excel. Some of their supplied files do open without having to do this, maybe because the first field is not labeled ID. It took me a while to get them all to work, but now I have a template to create my .xls master files. I also have these notes, which may help. Since Combinations contain commas within a single field, the entire file cannot be comma separated. I did a replacement using Notepad again. Some of their supplied files were also ; delimited, so I had to do a replacement there as well. BETTER:open file in notepadereplace , with -replace ; with ,save file. doneFOR COMBINATIONS:Replace all , with `This will be the Multiple value separator (fields are still delimited with a comma) I hope this is helpful. It's been a few weeks since I played around with modifying their supplied files but I am able to use everything. LMK how you do. Link to comment Share on other sites More sharing options...
PaulJANSSENS Posted July 28, 2016 Share Posted July 28, 2016 (edited) I found the solution by modifying the "adminimportcontroller.php" file. The PHP7 server version is problematic. I found the soltion on CSV import on PHP 7 needs a little patch: https://github.com/P...aShop/pull/5604 Edited July 29, 2016 by PaulJANSSENS (see edit history) Link to comment Share on other sites More sharing options...
Holzy_27 Posted July 11, 2020 Share Posted July 11, 2020 I know this threat is very old but my solution was to reorder the lines in the csv file - category's parent category should exist in the upper lines.. Link to comment Share on other sites More sharing options...
andresaldana Posted January 14, 2021 Share Posted January 14, 2021 Start the ID with the number 3 and following 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now