I'm trying to import items with CSV - in the 'customizable' column it says "(0 = No, 1 = Yes)".
I've read a few other threads about this and it looks like it should be formatted like this:
"Field 1"|1, "Field 2"|1
But when I try to upload the products with that syntax in the customizable column - it fails the import.
If I change it to just 1 or 0, the upload succeeds; but then I have to go into each product, then click on customization, then click on customization text and save it (which is what I'm trying to avoid with the CSV in the first place).
What is the appropriate way to format the upload CSV so that the customizable fields save appropriately?
I'm using 1.6.1.4.
Well unfortunately it doesn't look like it's an option by the default CSV import (which is a bummer).
I was able to solve it by writing a small script to adjust the database.
The script looks like this:
// Create connection
$conn = new mysqli($servername, $username, $password, $database);
/* check connection */
if ($conn->connect_errno) {
printf("Connect failed: %s\n", $mysqli->connect_error);
exit();
}
echo "Connected successfully<br /><br />";
$conn->query("update ps_category_lang set name=SUBSTRING_INDEX(name, '(', 1) WHERE name REGEXP '([[:digit:]]+)';");
$conn->query("truncate table ps_customization_field;");
$conn->query("INSERT INTO ps_customization_field (id_product,type,required) SELECT id_product,0,0 FROM ps_product WHERE id_shop_default = 1 AND customizable = 1;");
$conn->query("INSERT INTO ps_customization_field (id_product,type,required) SELECT id_product,1,1 FROM ps_product WHERE id_shop_default = 1 AND customizable = 1;");
echo "Added uploadable files & customized field to each item!<br /><br />";
$conn->query("truncate table ps_customization_field_lang;");
$conn->query("INSERT INTO ps_customization_field_lang (id_customization_field, id_lang,id_shop,name) select id_customization_field,1,1,'Upload 1' from ps_customization_field WHERE type = 0;");
$conn->query("INSERT INTO ps_customization_field_lang (id_customization_field, id_lang,id_shop,name) select id_customization_field,1,1,'Field 1' from ps_customization_field WHERE type = 1;");
echo "Added appropriate labeling for each field, for each product!<br /><br />";
echo "<h2>Yay, We're done!</h2>";
$conn->close();
Obviously this can be updated/changed to meet the requirements of whomever.