mahiiro Posted April 28, 2015 Share Posted April 28, 2015 Hi ! I want to import product in prestashop, and I need that all product get a text field. So I use this : Text field (0 = No, 1 = Yes) But, after import I need to go to every imported products, go to Customization tab, give my field a name and save. I read this topic : https://www.prestashop.com/forums/topic/319630-csv-import-and-file-fields/ and try : "fieldname1"|1, "fieldname2"|1, "fieldname3"|0, "fieldname4"|0 But then I get a error message : Property Product->text_fields is not valid Have anyone a solution for that problem ? 1 Link to comment Share on other sites More sharing options...
folkifoon Posted July 3, 2015 Share Posted July 3, 2015 Hi i would like to have this question answered also! Anyone found a solution? Link to comment Share on other sites More sharing options...
mahiiro Posted July 5, 2015 Author Share Posted July 5, 2015 Hi, I nedeed to add a text filed for all my product so I create this script and launch it : $db = new DB(); if (($db != null) && ($db->isOk())) { $rs = mysql_query("update ps_category_lang set name=SUBSTRING_INDEX(name, '(', 1) WHERE name REGEXP '([[:digit:]]+)';"); $rs = mysql_query("truncate table ps_customization_field;"); $rs = mysql_query("INSERT INTO ps_customization_field (id_product,type,required) SELECT id_product,1,0 FROM ps_product WHERE id_shop_default = 2;"); $rs = mysql_query("truncate table ps_customization_field_lang;"); $rs = mysql_query("INSERT INTO ps_customization_field_lang (id_customization_field, id_lang,id_shop,name) select id_customization_field,1,2,'Taille du cadre' from ps_customization_field;"); } You could adapt it and use it. Link to comment Share on other sites More sharing options...
folkifoon Posted July 5, 2015 Share Posted July 5, 2015 I never did such a thing.Can you help me a bit more?First i make a .txt file with that code?Where do i specify the products?How do i run the script? thanks! Link to comment Share on other sites More sharing options...
mahiiro Posted July 6, 2015 Author Share Posted July 6, 2015 No, it's a php file, you must run it from the browser. This bit of code delete the content of the table ps_customization_field and ps_customization_field_lang and add for each product where is in the shop 2, a text field named 'Taille du cadre'. So you will have to adapt it for your use. And you must enter the information to connect DB. 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