Bejo Posted October 14, 2012 Share Posted October 14, 2012 i'm tried import products with csv on ps 1.5.1 everything success. but the default category products automatic being in Home Category. ID insert this at Categories(x,y,z...) csv -> still can fully understand about this condition. Example: already tried this - Home, iPods iPods, iPods Battery ( success but default category automatic being -Home ), how to made default category is -iPods Battery. and i tried ; - iPods Battery, Home, iPods iPods, iPods Battery ( everything categories is missing with this condition). Wishing somebody can give hand to me! thank already searching but nothing. thx Link to comment Share on other sites More sharing options...
protokos Posted October 14, 2012 Share Posted October 14, 2012 Hi can you also make a printscreen of the import file, on that category?? Link to comment Share on other sites More sharing options...
Bejo Posted October 15, 2012 Author Share Posted October 15, 2012 sure! here upload screen print and resulted used command! thx Link to comment Share on other sites More sharing options...
protokos Posted October 15, 2012 Share Posted October 15, 2012 Hi thanks,, is it possible to let me see more of the import file , i mean the more categories maybe there is the difference Wil. Link to comment Share on other sites More sharing options...
romeo.angelin Posted November 20, 2012 Share Posted November 20, 2012 I need some help .. with same problem.. I'm trying to build my csv with 3rd level category.. but .. i think something is wrong.. .. and doesn't work. Any advice.. are welcome. Thank you.. Maybe one sample.. different from that one from prestashop admin. Thank you Link to comment Share on other sites More sharing options...
lionsoul Posted January 10, 2013 Share Posted January 10, 2013 (edited) Hello, I have the same problem, is a tree category of Home, and I tried putting: "Home, Pruebas" "Home, Pruebas" "Pruebas" and always shows only only.. the category "Home" I'm use Prestashop 1.5.3.1 and the official CSV template would appreciate a solution to import through CSV and is an essential tool Certainly would not hurt a function to export it? although to do so cumbersome using mysql help Edited January 10, 2013 by ibairg (see edit history) Link to comment Share on other sites More sharing options...
shearer Posted January 10, 2013 Share Posted January 10, 2013 i have the same problem. really need a fix Link to comment Share on other sites More sharing options...
lionsoul Posted January 10, 2013 Share Posted January 10, 2013 I'm no expert, but I think it has something to do with that part of MySql should create a new row only changing the id_category using mysql and already does this value: INSERT INTO `` myshop1. MyShop_category_product `` ( id_category ``, id_product ``, `position` ) VALUES ( '2 ', '2', '3 ' ); but would have to create one for the other category we write in the csv: INSERT INTO `` myshop1. MyShop_category_product `` ( id_category ``, id_product ``, `position` ) VALUES ( '11 ', '2', '3 ' ); i don't know if it is BUG or not are the code to this action, because I'm not a php expert Link to comment Share on other sites More sharing options...
ihkwyh Posted January 23, 2013 Share Posted January 23, 2013 Solution: Line 645 and Line 647 in - controllers/admin/AdminImportController.php Change: line 645 do $uniqid = uniqid(); while (file_exists(_PS_UPLOAD_DIR_.$uniqid)); $tmp_file = file_put_contents($uniqid, $field); line 647 $fd = fopen($temp, 'r'); $tab = fgetcsv($fd, MAX_LINE_SIZE, $separator); fclose($fd); To: do $uniqid = _PS_UPLOAD_DIR_.uniqid(); while (file_exists($uniqid)); $tmp_file = file_put_contents($uniqid, $field); $fd = fopen($uniqid, 'r'); $tab = fgetcsv($fd, MAX_LINE_SIZE, $separator); fclose($fd); OR comment out lines 636 - 656 (until the issue is resolved) and ADD the lines protected static function split($field) { if (empty($field)) return array(); if (is_null(Tools::getValue('multiple_value_separator')) || trim(Tools::getValue('multiple_value_separator')) == '') $separator = ','; else $separator = Tools::getValue('multiple_value_separator'); $temp = tmpfile(); fwrite($temp, $field); rewind($temp); $tab = fgetcsv($temp, MAX_LINE_SIZE, $separator); fclose($temp); if (empty($tab) || (!is_array($tab))) return array(); return $tab; } Either one of these options works, not sure which is better. Solves both the 'No Image' issue and the category 'always being Home' issue. Hope this helps everyone. Thanks to this poster and github https://github.com/PrestaShop/PrestaShop/commit/8d7196daf3b39d280c631882f0e3ebe473233d07 for pointing me in the right direction. His solution changes more than needs to be to resolve the issue, and was harder to find the I hope this will be. 2 Link to comment Share on other sites More sharing options...
ihkwyh Posted January 23, 2013 Share Posted January 23, 2013 second solution is the prestashop function from v1.5.1 (i think thats what it is anyway * @version Release: $Revision: 8971 $) Link to comment Share on other sites More sharing options...
papista Posted January 25, 2013 Share Posted January 25, 2013 Thanks much. Second solution works for me.. presta 1.5.3.1 Link to comment Share on other sites More sharing options...
ricky11 Posted January 25, 2013 Share Posted January 25, 2013 It is surprising that we have come so far in the community edition, but never has this issue been officially resolved in the 1.5 releases? Importing into certain category is a basic feature, and again i am surprised that it went un-noticed in all the previous version... as of now out of the box it still does not work, i.e. all products goto home category! 1.5.3.1 Link to comment Share on other sites More sharing options...
ricky11 Posted January 25, 2013 Share Posted January 25, 2013 By the way also the second solution worked for me as well (category) have not tried the images... is this going to be fixed in the next release? Link to comment Share on other sites More sharing options...
romper Posted February 25, 2013 Share Posted February 25, 2013 The second option works for prestashop 1.5.3.1. It is really confusing why the newest release appears with this bug. Link to comment Share on other sites More sharing options...
jetlasers Posted April 19, 2013 Share Posted April 19, 2013 what do you mean by "OR comment out lines 636 - 656 (until the issue is resolved) and ADD the lines"? Esp. "comment out"? Is it "replacing" the lines with what you wrote? Thanks!!!!! Link to comment Share on other sites More sharing options...
ihkwyh Posted April 19, 2013 Share Posted April 19, 2013 I mean you can either change the two lines that need to be changed (Line 645 and Line 647 in - controllers/admin/AdminImportController.php) Change: line 645 do $uniqid = uniqid(); while (file_exists(_PS_UPLOAD_DIR_.$uniqid)); line 647 $fd = fopen($temp, 'r'); To: line 645 do $uniqid = _PS_UPLOAD_DIR_.uniqid(); while (file_exists($uniqid)); line 647 $fd = fopen($uniqid, 'r'); OR comment out lines /*636 - 656*/ = Add this /* to the front of line 636, add this */ to the end of line 656 (until the issue is resolved) = until they fix this code so you don't have to make changes and ADD the lines = copy and paste the posted code just after section of code you just commented out. Doing it this way leaves the original code in place should you need it for any reason. Link to comment Share on other sites More sharing options...
Recommended Posts