Import products with images from CSV
Posted: 23 Oct 2019, 18:14
I try to import products from a CSV file on my local Mac using the instructions and example from
https://aimeos.org/docs/Developers/Cont ... s_from_CSV
My problem is that products are uploaded but no images and I get some error messages I can't understand.
I did minor changes in products-import-example.csv adding media.preview beside the media.url, not sure if I need both though.
My configuration looks like this:
The images (image.jpg and image2.jpg) are placed in /Users/myuser/dev/AimeosEXP/import/media.
I run the import using the command php artisan aimeos:jobs product/import/csv
Executing the Aimeos job gives me some errors that I can't solve.
Invalid product lines in "/Users/myuser/dev/AimeosEXP/import": 1/4#0 /Users/myuser/dev/AimeosEXP/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Command/JobsCommand.php(69): Aimeos\Controller\Jobs\Product\Import\Csv\Standard->run()
...
#23 {main}Process (PID "9350") failed with status "256"iMac:AimeosEXP myuser$
Three products are uploaded to Aimeos. job_csv_test, job_csv_test2 and one empty product. No images!
The Aimeos log shows some additional error messages:
Finished product import from "/Users/myuser/dev/AimeosEXP/import": 3 successful, 1 errors, 4 total (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Imported product lines from "product-import-example.csv": 2/2 (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Imported product lines from ".DS_Store.csv": 1/2 (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Started product import from "/Users/myuser/dev/AimeosEXP/import" (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Finished product import from "/Users/myuser/dev/AimeosEXP/import": 3 successful, 1 errors, 4 total (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Imported product lines from "product-import-example.csv": 2/2 (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Imported product lines from ".DS_Store.csv": 1/2 (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Started product import from "/Users/myuser/dev/AimeosEXP/import"
Unable to import product with code "]ShowStatusBar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds[ShowSidebar_{{400": Code "]ShowStatusBar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds[ShowSidebar_{{400" must not be longer than 64 characters
Unable to import product with code "]ShowStatusBar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds[ShowSidebar_{{400": Code "]ShowStatusBar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds[ShowSidebar_{{400" must not be longer than 64 characters
I don't know if the problems are caused by the CSV file or something else?
https://aimeos.org/docs/Developers/Cont ... s_from_CSV
My problem is that products are uploaded but no images and I get some error messages I can't understand.
I did minor changes in products-import-example.csv adding media.preview beside the media.url, not sure if I need both though.
Code: Select all
"item code","item label","item type","item status","text type","text content","text type","text content","media preview","media url","price currencyid","price quantity","price value","price tax rate","attribute code","attribute type","subproduct code","product list type","property value","property type","catalog code","catalog list type"
"job_csv_test","job csv test product","default",1,"short","short description","long","long description","media/image.jpg","media/image.jpg","EUR",1,"11.00","20.00","import-test","size",,,"1.50","package-weight","home","promotion"
"job_csv_test2","job csv test 2. product","select",1,"short","short selection description","long","long selection description","media/image2.jpg","media/image2.jpg","EUR",1,"10.00","20.00",,,"job_csv_test","default","1.50","package-weight","home","default"
Code: Select all
'client' => [
'html' => [
'common' => [
'content' => [
'baseurl' => '/Users/myuser/dev/AimeosEXP/import',
...
'controller' => [
'common' => [
'product' => [
'import' => [
'csv' => [
'mapping' => [
'item' => [
0 => 'product.code', // e.g. unique EAN code
1 => 'product.label', // UTF-8 encoded text, also used as product name
2 => 'product.type', // type of the product, e.g. "default" or "selection"
3 => 'product.status', // enabled (1) or disabled (0)
],
'text' => [
4 => 'text.type', // e.g. "short" for short description
5 => 'text.content', // UTF-8 encoded text
6 => 'text.type', // e.g. "long" for long description
7 => 'text.content', // UTF-8 encoded text
],
'media' => [
8 => 'media.preview', // relative URL of the product image on the server
9 => 'media.url', // relative URL of the product image on the server
],
'price' => [
10 => 'price.currencyid', // three letter ISO currency code
11 => 'price.quantity', // the quantity the price (for block pricing)
12 => 'price.value', // price with decimals separated by a dot
13 => 'price.taxrate', // tax rate with decimals separated by a dot
],
'attribute' => [
14 => 'attribute.code', // code of an attribute, will be created if not exists
15 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
],
'product' => [
16 => 'product.code', // e.g. EAN code of another product
17 => 'product.lists.type', // e.g. "suggestion" for suggested product
],
'property' => [
18 => 'product.property.value', // arbitrary value for the corresponding type
19 => 'product.property.type', // e.g. "package-weight"
],
'catalog' => [
20 => 'catalog.code', // e.g. Unique category code
21 => 'catalog.lists.type', // e.g. "promotion" for top seller products
],
],
],
],
],
],
'jobs' => [
'product' => [
'import' => [
'csv' => [
'location' => '/Users/myuser/dev/AimeosEXP/import',
'skip-lines' => 1,
],
],
],
],
],
I run the import using the command php artisan aimeos:jobs product/import/csv
Executing the Aimeos job gives me some errors that I can't solve.
Invalid product lines in "/Users/myuser/dev/AimeosEXP/import": 1/4#0 /Users/myuser/dev/AimeosEXP/vendor/aimeos/aimeos-laravel/src/Aimeos/Shop/Command/JobsCommand.php(69): Aimeos\Controller\Jobs\Product\Import\Csv\Standard->run()
...
#23 {main}Process (PID "9350") failed with status "256"iMac:AimeosEXP myuser$
Three products are uploaded to Aimeos. job_csv_test, job_csv_test2 and one empty product. No images!
The Aimeos log shows some additional error messages:
Finished product import from "/Users/myuser/dev/AimeosEXP/import": 3 successful, 1 errors, 4 total (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Imported product lines from "product-import-example.csv": 2/2 (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Imported product lines from ".DS_Store.csv": 1/2 (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Started product import from "/Users/myuser/dev/AimeosEXP/import" (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Finished product import from "/Users/myuser/dev/AimeosEXP/import": 3 successful, 1 errors, 4 total (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Imported product lines from "product-import-example.csv": 2/2 (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Imported product lines from ".DS_Store.csv": 1/2 (Aimeos\Controller\Jobs\Product\Import\Csv\Standard)
Started product import from "/Users/myuser/dev/AimeosEXP/import"
Unable to import product with code "]ShowStatusBar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds[ShowSidebar_{{400": Code "]ShowStatusBar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds[ShowSidebar_{{400" must not be longer than 64 characters
Unable to import product with code "]ShowStatusBar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds[ShowSidebar_{{400": Code "]ShowStatusBar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds[ShowSidebar_{{400" must not be longer than 64 characters
I don't know if the problems are caused by the CSV file or something else?