Well it match, i check it few times. I opened the uploaded file with Excel to have better view, every columns is here.
$csv = "reference;ean13;actif;nom;categories;prix;marque;Quantité;Description courte;Description;Balise de titre;Méta description;URLs des images;id;id tax rule" . PHP_EOL;
Example of generated line :
198109913;;1;GUGA;BRAZBIKE;33.33;ESOL;0;;;;;http://website.com/media/photos/1-EXT1.png;198109913;3
I got the same error when i echo the webpage :
No Name (ID: ESOL) ne peut pas être enregistré
Property Product->name is empty
But the manufacturer existe, in the right shop id...
Yes, i got the token (with some modification), when i do a echo of $request->webpage
I'm logged in AdminImport.
There is a prestashop notification error about an empty product name, but there is not.
And when i try it manually, I don't have this error notification.
I verified like 5 times the typevalue and columns of the csv, can't see a problem...
I got no error.
So i d'ont understand why
$matchColumn = array(
0 => 'reference',
1 => 'ean13',
2 => 'active',
3 => 'name',
4 => 'category',
5 => 'pricetex',
1 => 'manufacturer',
2 => 'quantity',
3 => 'descriptionshort',
4 => 'description',
5 => 'metatitle',
4 => 'metadescription',
5 => 'image',
6 => 'id',
7 => 'idtaxrules_group'
);
$importType=1;
$request->setPost(array(
"controller" => "AdminImport",
"token" => $token,
"skip" => 0,
"csv" => $returnFilename,
"convert" => '',
"regenerate" => '',
"entity" => $importType, //1 is for products import
"isolang" => "fr",
"truncate" => 0,
"forceIDs" => 0,
"matchref" => 1,
"separator" => ";",
"multiplevalueseparator" => ",",
"import" => 1,
"type_value" => $matchColumn
I'm trying to use this script too.
The file is correctly uploaded but nothing happen after...
When i do it manually with the uploaded file, got products imported...
I'm on PrestaShop™ 1.6.0.8, any suggestion ? i don't see any error that can explain that...
Ok i'm just stupid...
If you check my $matchColumn the key of my array elements are wrong...
My bad...