m3w Posted November 7, 2013 Share Posted November 7, 2013 Hello, i've a cron script that every 30 min import and update the products from a xml file, that's work fine. My problem is the attribute value, that seems not import the right size with comma. For example i've in my xml file: <size1>10</size1> <size2>10,5</size2> In product admin page, combinations section, i've: Size 10 | Reference: 10 Size 10 | Reference: 10,5 So in the attribute value the 10,5 become 10, i think it's a comma problem, and when a customer add the product with size 10, i don't know if he meant 10,5 or 10. Hope i've explained my problem, please help to figuered out Thanks Link to comment Share on other sites More sharing options...
parsifal Posted November 8, 2013 Share Posted November 8, 2013 Maybe PrestaShop always expects a dot . character as a delimiter for decimal digits in a number, regardless of your country and locale settings? I know for certain that this is also the case when doing CSV import. So, I would do a little test with dots instead of commas and see what happens. Link to comment Share on other sites More sharing options...
NemoPS Posted November 8, 2013 Share Posted November 8, 2013 It's weird, did you use comma as 'multiple value separator' before importing? Link to comment Share on other sites More sharing options...
m3w Posted November 8, 2013 Author Share Posted November 8, 2013 I've tried with dot instead of comma and it works. I think is Prestashop that cuts the number after the comma, any ideas how to figured it out? Link to comment Share on other sites More sharing options...
vekia Posted November 8, 2013 Share Posted November 8, 2013 it's not prestashop but mysql, in databases like this one you need to use dots as a decimal separator (US method) Link to comment Share on other sites More sharing options...
m3w Posted November 8, 2013 Author Share Posted November 8, 2013 it's not prestashop but mysql, in databases like this one you need to use dots as a decimal separator (US method) Do you know if it's possible allow commas in mysql? Link to comment Share on other sites More sharing options...
vekia Posted November 8, 2013 Share Posted November 8, 2013 unfortunately, you can't that's the mysql standard. In addition to this, if you will change it to dot, you will need to change whole core of ps which support dots. Why you want to use commas? Maybe there is an easy way to achieve what you expect with different and possible solution Link to comment Share on other sites More sharing options...
Mykhailo Posted November 6, 2014 Share Posted November 6, 2014 Hi! I have similar problem, but with text values. I'm trying to import like: attribute1: blue, red, white attribute2: red, green, yellow but after import I get just: attribute1: blue attribute2: red It looks like CSV import tool cuts of the value after first comma. I'm using version 1.6.0.9, ; as field delimiter, " as value delimiter. Link to comment Share on other sites More sharing options...
NemoPS Posted November 7, 2014 Share Posted November 7, 2014 You are using the double quotes as multiple values delimiter? Link to comment Share on other sites More sharing options...
parsifal Posted November 7, 2014 Share Posted November 7, 2014 Could it be the space character after the comma...? Link to comment Share on other sites More sharing options...
Mykhailo Posted November 7, 2014 Share Posted November 7, 2014 I tried different multiple values delimiters - no luck. comma (obviously fails), double quotes. It imports okay values with dots in it (i.e. attribute1: blue. red. yellow) , but not with commas. Link to comment Share on other sites More sharing options...
NemoPS Posted November 8, 2014 Share Posted November 8, 2014 Weird, any character should work as long as you set it appropriately in the importer. But indeed, as pasifal pointed out it might be the space Link to comment Share on other sites More sharing options...
Mykhailo Posted November 8, 2014 Share Posted November 8, 2014 Pretty weird, 'cause space with dots values (like "red. blue. yellow.") are imported without any issue, while values with space and comma ("red, blue, yellow") get truncated. So the space does not matter here? Link to comment Share on other sites More sharing options...
parsifal Posted November 8, 2014 Share Posted November 8, 2014 (edited) If dots followed by spaces work, but commas followed by spaces don't, it sounds like a bug in PrestaShop's CSV parser or at the very least a serious inconsistency. Have you tried with commas and no spaces yet? I'm also favoring the use of spaces after commas for readability purposes but only when writing code, not in cases like this. Edited November 8, 2014 by parsifal (see edit history) Link to comment Share on other sites More sharing options...
Mykhailo Posted November 8, 2014 Share Posted November 8, 2014 Have not tried with commas without spaces, 'cause the spaces are exactly what I need there I'm using a workaround: importing with dots and spaces and then changing dots to commas. But it feels so wrong. Link to comment Share on other sites More sharing options...
savedario Posted September 26, 2016 Share Posted September 26, 2016 (edited) I know it's a rather old question but... I am struggling to import into PS products that have attributes with commas in their names (e.g. "fish, red"), which works fine if entered in the backend, but causes troubles when importing. I think the issue here is that the import treats certain columns (e.g. Categories and Attribute / Value) as multi-value, where each value is separated with a comma from the other. E.g.: 123;red,blue;Pants describes the product Pants, with ID 123 and that belongs to the categories red AND blue. Edit: And of course the solution (duh) in PS 1.6.1.6 is to choose a different multi-value delimiter, possibly a character that is not in the attribute names (e.g. |)... Edited September 26, 2016 by savedario (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts