Scotty501 Posted December 29, 2010 Share Posted December 29, 2010 I am trying to test a CSV import - but I am getting the following error:-/home/ukushost/public_html/testshop/office/tabs/AdminImport.php on line 356Assuming the above can be fixed easy enough - I have a couple of follow on questions which are not clear in the Wiki. If a product appears in sub-categories as well as its own category - how do you handle this with the import? It could be three or four categories deep. Any guidance would be great. Link to comment Share on other sites More sharing options...
rocky Posted December 30, 2010 Share Posted December 30, 2010 What version of PrestaShop are you using? You can put a product in as many categories as you want via CSV just by entering all the category IDs separated by commas. For example:ID;Name;Categories (x,y,z...)1;Product 1;1,2,3This will create product called "Product 1" that is in categories 1, 2 and 3. Change it as appropriate. Add any other columns you want to use. Link to comment Share on other sites More sharing options...
Scotty501 Posted December 30, 2010 Author Share Posted December 30, 2010 Thanks Rocky - appreciate the response. Version 1.3.1.1I played with the spreadsheet a little and the fatal error went away so I assume that it was an error in the csv or rather what it was seeing during the import.A follow on question if I may.Will the import automatically add categories that do not exist? If I understand correctly, if I want attributes to be included - I would have to do this as a separate import and the import would find the product to apply the attributes to? Again, if they do not exist - will they insert the new attributes?Sorry - but the Wiki does not cover it very well - and I have potentially 25K worth of items to import and I need to get it right. Link to comment Share on other sites More sharing options...
rocky Posted December 30, 2010 Share Posted December 30, 2010 PrestaShop will only create the categories if you specify them as names instead of IDs. For example, "Category 1","Category 2","Category 3" instead of 1,2,3. I prefer not to use names though, since you can't have multiple categories with the same name. If you have categories with the same name, you must use category IDs and create a separate CSV for the categories. Link to comment Share on other sites More sharing options...
Scotty501 Posted December 30, 2010 Author Share Posted December 30, 2010 Right - confused as hell now So, under the category column - it has to be an existing category?? If I want to add the additional category - I would have use the name field? Or are you saying under the category field I would have to enter the full category name for it to be recognised??? IE - TestCat1, TestCat2, TestCat3 would create three new categories named as such?Sorry Rocky I am not following you on this. (PS Renamed the thread to make it more useful to others) Link to comment Share on other sites More sharing options...
rocky Posted December 30, 2010 Share Posted December 30, 2010 I mean that if you enter the categories as IDs, then it won't automatically create the categories. You will end up with products imported and no categories. You will need to import the categories separately, otherwise the products will be in categories that don't exist.If you enter the categories as names, then PrestaShop will check for a category with that name and use its ID, or create the category if it doesn't exist, then use that ID.At least that is my understanding of how it works. I don't actually have a lot of experience importing products and categories myself.UPDATE: Actually, looking at the code, it appears a new category is created even if IDs are used, but the category will have the ID as the category name, which doesn't look good. Link to comment Share on other sites More sharing options...
Scotty501 Posted December 30, 2010 Author Share Posted December 30, 2010 OK - I understand that part. You say "name" - I understand that to be the field called "Name" - where the import does have column called "Category" - do you mean enter a category name here - not an ID number or do you mean put the category (desired name if does not exist) in the name field?I have a test site to play with - but this is causing me headaches - I appreciate you help as usual. Link to comment Share on other sites More sharing options...
rocky Posted December 30, 2010 Share Posted December 30, 2010 I mean use names in the categories field, if you don't have any categories with duplicate names, like this: ID;Name;Categories (x,y,z…) 1;Product 1;"Category 1","Category 2","Category 3" Link to comment Share on other sites More sharing options...
Scotty501 Posted December 30, 2010 Author Share Posted December 30, 2010 OK got ya - I think.So if there are products that need to go into multiple Categories - some exist some dont, I have create those categories first via an import (or manually) and then import the products?How does this work for sub-category? Same way I assume - it will look for a category name and insert product there (assuming it exists)? Does the import not care if its a sub-category or not - just as long as it finds the name/id?So all in all - I am better off creating the sub-cat's - and then importing products, specifying the id or category name during the product import?Sorry if I am being slow. Link to comment Share on other sites More sharing options...
rocky Posted December 30, 2010 Share Posted December 30, 2010 If you have subcategories, you should import all the categories first, then the products, since you can't make a category a subcategory of another using just a product import. You can only use an existing category structure. Link to comment Share on other sites More sharing options...
Scotty501 Posted December 30, 2010 Author Share Posted December 30, 2010 OK understood - thanks Rocky - I will feedback how I get on. 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