Prestashop

De WikiMar
Dreceres ràpides: navegació, cerca

Debug

/var/www/test.dafyn.com/htdocs/prestashop/config/config.inc.php

@ini_set('display_errors', 'on');



Import images with Prestashop using CSV import tool

sudo vi /var/www/test.dafyn.com/htdocs/prestashop/controllers/admin/AdminImportController.php
...
# Solution marti taken from http://www.prestashop.com/forums/topic/218088-fix-for-1531-failure-to-upload-images-with-csv-file/
do $uniqid_path = _PS_UPLOAD_DIR_.uniqid(); while (file_exists($uniqid_path));
file_put_contents($uniqid_path, $field);
$fd = fopen($uniqid_path, 'r');

        #       do $uniqid = uniqid(); while (file_exists(_PS_UPLOAD_DIR_.$uniqid));
        #       $tmp_file = file_put_contents(_PS_UPLOAD_DIR_.$uniqid, $field);
        #       $fd = fopen($temp, 'r');


                $tab = fgetcsv($fd, MAX_LINE_SIZE, $separator);
                fclose($fd);
        #       unlink($tmp_file);
unlink($uniqid_path);

# Solution 2: http://www.prestashop.com/forums/topic/215671-probleme-import-produit-csv/
        #       $fd = fopen($temp, 'r');
$fd = fopen(_PS_UPLOAD_DIR_.$uniqid, 'r');


<Manual Steps to import>

Replace:

([^"]*\.gif)
/var/www/test.dafyn.com/htdocs/img_productes/\1
([^"]*\.jpg)
/var/www/test.dafyn.com/htdocs/img_productes/\1
([^"]*\.tif)
/var/www/test.dafyn.com/htdocs/img_productes/\1
"2000
"


ftp to /var/www/test.dafyn.com/htdocs/prestashop/admin2/import/