Arkadia Posted December 23, 2012 Share Posted December 23, 2012 (edited) Hi guys, I'm using prestashop 1.5.2.0... I'm having a hard time importing features via a csv. I'm using this format: FeatureName:FeatureValue:FeaturePosition In my case I only have 1 feature to add...called part number...so it looks like this in the "features" column of the csv Part Number:34400:1 But it's not working correctly. I'm trying with just 5 products for now...just to try and get it to work...and it imports one product and dies after that...I have to reload the page and I'll find that just the first product was imported...instead of it saving the feature as Part Number with a value of 34400 it just saves "34400" as a feature name and the value is blank... It's like it totally ignores the feature name when you upload the csv - all you see is the value 34400. See screencap attached below: featurecolumn.jpg I'm unable to upload my csv file to this forum...so I've uploaded it as a text file...and also a screenshot of my excel sheet to make it easier to read the features column... The csv is in this order: ID, Active, Name, Categories, Price Tax Excl, Tax Rules ID, Wholesale Price, On Sale, Reference, Manufacturer, EAN13, UPC, Ecotax, Weight, Qty, Short Description, Description, Meta-title, Meta-Description, Available for order, Show Price, Feature, Available Online, Condition Also worth noting: if I select "ignore this column" - to ignore the features column...then all 5 products import fine...so I know that the process is dying at the features column during the import. Please help if you have any idea what's going wrong? Thanks so much!! ps_product29.txt Edited January 9, 2013 by Arkadia (see edit history) Link to comment Share on other sites More sharing options...
Sippa Posted December 31, 2012 Share Posted December 31, 2012 (edited) Hi I used a fresh 1.5.3 Tried your csv file and uploaded for products. It created the necessary feature and added the value too. Only change: I had to clear the "NULL"-s from your file. If you change to 1.5.3 you will experience other problems like: always auto-increment for ID-s, image upload not working and products will all be in "home" category. Edited December 31, 2012 by Sippa (see edit history) Link to comment Share on other sites More sharing options...
Arkadia Posted January 3, 2013 Author Share Posted January 3, 2013 (edited) Hi I used a fresh 1.5.3 Tried your csv file and uploaded for products. It created the necessary feature and added the value too. Only change: I had to clear the "NULL"-s from your file. If you change to 1.5.3 you will experience other problems like: always auto-increment for ID-s, image upload not working and products will all be in "home" category. Hi Thank you so much for taking the time to try this out. I'd rather stick to figuring it out with 1.5.2 since it's likely going to be a considerably larger issue to deal with 1.5.3 bugs that you've mentioned --- sigh. I also tried removing NULL values in the csv but to no avail. Hmmm, I'm thinking maybe I can create the features table manually via sql...I have a 1.4 version of the site with all the products in there...so maybe if I can find the relevant tables, I could import them into the 1.5.2 version of the site...problem is the database is so very different between 1.4 and 1.5 that I'm not sure if this is the cleanest solution. Anyone have any ideas? Also maybe if anyone could tell me which database tables I should be concerned with in order to do it this way...that would be awesome! I have over 20000 products to deal with...so this could get messy! Any guidance I could get would be appreciated... Edited January 3, 2013 by Arkadia (see edit history) Link to comment Share on other sites More sharing options...
Arkadia Posted January 9, 2013 Author Share Posted January 9, 2013 (edited) Okay, well as usual...I don't get replies from the prestashop team. They probably don't like me much. The tables I exported from 1.4. where ps_feature, ps_feature_lang, ps_feature_product, ps_feature_value, ps_feature_value_lang They need to be imported into 1.5.2 AFTER you've completed importing your products. (Note: this is for people who have had to csv import products as well). (I haven't tried 1.5.3 yet but as Sippa mentioned above, there's an auto-increment id issue which will ruin this method because the feature tables depend on your products having the same id's as they originally did in 1.4.) Worked out fine in 1.5.2.0. All my products have features on them now. Edited January 9, 2013 by Arkadia (see edit history) Link to comment Share on other sites More sharing options...
shearer Posted January 10, 2013 Share Posted January 10, 2013 how did you get the import features function to work ? when i want to import some product i cant find the feature function. or an example on how to do this. can someone help ? Link to comment Share on other sites More sharing options...
Arkadia Posted January 22, 2013 Author Share Posted January 22, 2013 how did you get the import features function to work ? when i want to import some product i cant find the feature function. or an example on how to do this. can someone help ? Hi Shearer, I am using prestashop 1.5.2.0 - the importing of product features seem to be broken. I couldn't do it via csv. In my case I had my store created in prestashop 1.4.9 and then I tried to upgrade to 1.5.2 - but EVERYTHING went wrong. Largely because the database is very different in 1.5 compared to 1.4... So first I exported all the relevant data from my 1.4 database using an sql statement (see my post here on how I did that http://www.prestashop.com/forums/index.php?/topic/189594-how-can-we-export-products-orders-etc-to-import-into-clean-15-install/page__view__findpost__p__1062481), and exported that data into an excel sheet. I then saved the excel sheet as a csv...and imported the csv via prestashop 1.5.2.0 - but the features wouldn't import. It just kept breaking the import. So I just imported the products WITHOUT the features...(select "ignore this line" for the features column when importing the csv) make sure you tick "FORCE PRODUCT ID'S" before you import. Then all the products were saved but without any features. Then I exported the feature tables from my 1.4 database as an sql file...and imported them into 1.5.2.0 database. (Note: you'll have to first drop the feature tables from the 1.5 database before you import them). Please try this with a COPY of your site and database! Never do it on your live site...or you're gonna have a bad time! So this procedure works if you've got a previous version of your site with all the products on it etc. If it is a NEW site and you're running a csv import for the first time...everything you just read...will be of no use to you. Sorry. Hopefully someone else knows how to help you in that case... Link to comment Share on other sites More sharing options...
MEG Venture Posted December 17, 2013 Share Posted December 17, 2013 For 1.5.6, I have another and weird solution by coincidence Note that I didn't replace the classes>FeatureValue.php as recommended through some github pages. I am using the original one. Please use this CSV format below. You'll see that all features are in one column separated by comma. ID;Active;Name;Category;Price Excl. OB;Tax ID Rules;Wholesale Price;On Sale;Discount amount;Discount percent;Discount from;Discount to;Reference;Supplier reference;Supplier;Manufacturer;EAN13;UPC;Eco tax;Weight;Quantity;Short description;Description;URL rewritten;Image URL;Feature 51;1;Modern Barstool 1;Home, Barstools;31.950.000;2;;;;;;;modern_barstool;;;;;;;;15;Lorem ipsum dolor sit amet, consec tetur adipiscing.;Lorem ipsum dolor sit amet, consec tetur adipiscing.;modern_barstool;http://www.righttothedoor.com/img/p/7/0/70.jpg;Height:100cm:0,Width:50cm:0,Depth:50cm:0,Color:Brown:0,Weight:1kg:0,Size::0 Forcing product id or not doesn't matter You don't need to pre-create feature values used in the CSV, if you don't, it will assign the feature value as a custom value. And here is the trick: When you come to the csv import view data - column assigning step, for the features column, select the column name as "Feature(Name:Value:Position)" but leave the custom name field below empty. If everything is set on other columns, click on the "Import .CSV data" button. You'll get the below error when you hit the import button. Fatal error: Cannot access empty property in blablabla...\controllers\admin\AdminImportController.php on line 792 Don't worry and simply click your browser's back button and again click on the "Import .CSV data" button. You're done! It is funny, huh? The point is that the empty feature name is not opened when we come back and it skips the empty field validation. Hopefully someone creates a bug report, coz I'm done. Link to comment Share on other sites More sharing options...
Recommended Posts