CSV Import works ok until I add stock fields.

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
johnnatan
Posts: 4
Joined: 01 Jun 2018, 00:11

CSV Import works ok until I add stock fields.

Post by johnnatan » 01 Jun 2018, 00:20

Hi ameos TEAM !!

Congrats to all community !!
I'm new to this. I hope you can help me.

I put this in shop.php

'controller' => [
'jobs' => [
'product' => [
'import' => [
'csv' => [
'location' => '/tmp/csv',
'container' => [
'type' => 'Directory',
'content' => 'CSV',
],
'item' => array(
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' => array(
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' => array(
8 => 'media.url', // relative URL of the product image on the server
),
'price' => array(
9 => 'price.currencyid', // three letter ISO currency code
10 => 'price.quantity', // the quantity the price (for block pricing)
11 => 'price.value', // price with decimals separated by a dot
12 => 'price.taxrate', // tax rate with decimals separated by a dot
),
'attribute' => array(
13 => 'attribute.code', // code of an attribute, will be created if not exists
14 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
),
'product' => array(
15 => 'product.code', // e.g. EAN code of another product
16 => 'product.lists.type', // e.g. "suggestion" for suggested product
),
'property' => array(
17 => 'product.property.value', // arbitrary value for the corresponding type
18 => 'product.property.type', // e.g. "package-weight"
),
'catalog' => array(
19 => 'catalog.code', // e.g. Unique category code
20 => 'catalog.lists.type', // e.g. "promotion" for top seller products
),
'stock' => array(
21 => 'stock.stocklevel', // three letter ISO currency code
22 => 'stock.dateback', // three letter ISO currency code
),
],
],
],
],
],


Then I run this command
php artisan aimeos:jobs product/import/csv

"D40530","ARTICLE TEST","default",1,"short","ARTICLE TEST","long","ARTICLE_TEST","files/5/2/52ae69dfda6adbe87514776546ddc95f.jpg","USD",12,28.72,12.15,,,,"default",20.51,"package-weight","home","promotion",1000,"2000-01-01 00:00:00"

It loads the articule but stock info is missing. Any help ??

Thanks !!

just fresh installed aimeos and laravel running on php7.0

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: CSV Import works ok until I add stock fields.

Post by aimeos » 01 Jun 2018, 21:03

You need to add a column for "stock.type" so the importer knows with type/warehouse your stock belongs to ("default" if you only have one).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

johnnatan
Posts: 4
Joined: 01 Jun 2018, 00:11

Re: CSV Import works ok until I add stock fields.

Post by johnnatan » 03 Jun 2018, 21:10

aimeos wrote:You need to add a column for "stock.type" so the importer knows with type/warehouse your stock belongs to ("default" if you only have one).
Hi !!

thanks for your fast help !! sorry for delay

I'm still stuck. I add this field on shop.php file and csv but just imports product info and stock info stills missing

Also I manually edit each imported product and just save it in order to see it in listings.

this is the files and info that I'm using.

thanks again for your help and sucess to all the aimeos team !!!

Johnnatan


1.- shop.php file::

'controller' => [
'jobs' => [
'product' => [
'import' => [
'csv' => [
'location' => '/tmp/csv',
'container' => [
'type' => 'Directory',
'content' => 'CSV',
],

'item' => array(
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' => array(
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' => array(
8 => 'media.url', // relative URL of the product image on the server
),
'price' => array(
9 => 'price.currencyid', // three letter ISO currency code
10 => 'price.quantity', // the quantity the price (for block pricing)
11 => 'price.value', // price with decimals separated by a dot
12 => 'price.taxrate', // tax rate with decimals separated by a dot
),
'attribute' => array(
13 => 'attribute.code', // code of an attribute, will be created if not exists
14 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
),
'product' => array(
15 => 'product.code', // e.g. EAN code of another product
16 => 'product.lists.type', // e.g. "suggestion" for suggested product
),
'property' => array(
17 => 'product.property.value', // arbitrary value for the corresponding type
18 => 'product.property.type', // e.g. "package-weight"
),
'catalog' => array(
19 => 'catalog.code', // e.g. Unique category code
20 => 'catalog.lists.type', // e.g. "promotion" for top seller products
),
'stock' => array(
21 => 'stock.stocklevel', // Integer
22 => 'stock.type', // the importer knows with type/warehouse your stock belongs to ("default" if you only have one).
23 => 'stock.dateback', // date intem available again
),
],
],
],
],
],



2.- csv file used


"job_csv_test","job csv test product","default",1,"short","short description","long","long description","path/to/image.jpg","USD",1,20,12,"import-test","size","","",18,"package-weight","home","promotion",22,"default","2018-07-01 00:00:00"

3.- command used

user@server:$ php artisan aimeos:jobs product/import/csv
Executing the Aimeos jobs for "default"

4.- MYSQL import log table (last row)

select * from madmin_log;


| 210 | 1 | message | 2018-06-03 20:58:38 | 3 | Not imported: Array
(
[21] => 22
[22] => default
[23] => 2018-07-01 00:00:00
)
| e68975b197b8e02eb5ddcee4b6e82a36 |

johnnatan
Posts: 4
Joined: 01 Jun 2018, 00:11

Re: CSV Import works ok until I add stock fields. [SOLVED]

Post by johnnatan » 04 Jun 2018, 06:36

I guys

I answer this question reading after read a little more. and after Mr aimeos user suggestions !!! Thanks a lot !!

I just added 'mapping'=> array( and closed. Finally Works !!

Thanks for your time and paticence..

Have all a Nice Day !!!


This is the file if someone needs it
'controller' => [
'jobs' => [
'product' => [
'import' => [
'csv' => [
'location' => '/tmp/csv',
'container' => [
'type' => 'Directory',
'content' => 'CSV',
],
'mapping'=> array(

'item' => array(
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' => array(
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' => array(
8 => 'media.url', // relative URL of the product image on the server
),
'price' => array(
9 => 'price.currencyid', // three letter ISO currency code
10 => 'price.quantity', // the quantity the price (for block pricing)
11 => 'price.value', // price with decimals separated by a dot
12 => 'price.taxrate', // tax rate with decimals separated by a dot
),
'attribute' => array(
13 => 'attribute.code', // code of an attribute, will be created if not exists
14 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
),
'product' => array(
15 => 'product.code', // e.g. EAN code of another product
16 => 'product.lists.type', // e.g. "suggestion" for suggested product
),
'property' => array(I guys

I answer this question reading after read a little more. and after

I just added 'mapping'=> array( and closed. Finally Works !!

Thanks for your time and paticence..

This is the file if someone needs it
'controller' => [
'jobs' => [
'product' => [
'import' => [
'csv' => [
'location' => '/tmp/csv',
'container' => [
'type' => 'Directory',
'content' => 'CSV',
],
'mapping'=> array(

'item' => array(
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' => array(
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' => array(
8 => 'media.url', // relative URL of the product image on the server
),
'price' => array(
9 => 'price.currencyid', // three letter ISO currency code
10 => 'price.quantity', // the quantity the price (for block pricing)
11 => 'price.value', // price with decimals separated by a dot
12 => 'price.taxrate', // tax rate with decimals separated by a dot
),
'attribute' => array(
13 => 'attribute.code', // code of an attribute, will be created if not exists
14 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
),
'product' => array(
15 => 'product.code', // e.g. EAN code of another product
16 => 'product.lists.type', // e.g. "suggestion" for suggested product
),
'property' => array(
17 => 'product.property.value', // arbitrary value for the corresponding type
18 => 'product.property.type', // e.g. "package-weight"
),
'catalog' => array(
19 => 'catalog.code', // e.g. Unique category code
20 => 'catalog.lists.type', // e.g. "promotion" for top seller products
),
'stock' => array(
21 => 'stock.stocklevel', // Integer
22 => 'stock.type', // the importer knows with type/warehouse your stock belongs to ("default" if you only have one).
23 => 'stock.dateback', // three letter ISO currency code
),
)
],
],
],
],
],


CSV FILE USED
"job_csv_test","job csv test product","default",1,"short","short description","long","long description","path/to/image.jpg","USD",1,20,12,"import-test","size","","",18,"package-weight","home","promotion",22,"default","2018-07-01 00:00:00"



17 => 'product.property.value', // arbitrary value for the corresponding type
18 => 'product.property.type', // e.g. "package-weight"
),
'catalog' => array(
19 => 'catalog.code', // e.g. Unique category code
20 => 'catalog.lists.type', // e.g. "promotion" for top seller products
),
'stock' => array(
21 => 'stock.stocklevel', // Integer
22 => 'stock.type', // the importer knows with type/warehouse your stock belongs to ("default" if you only have one).
23 => 'stock.dateback', // three letter ISO currency code
),
)
],
],
],
],
],


CSV FILE USED
"job_csv_test","job csv test product","default",1,"short","short description","long","long description","path/to/image.jpg","USD",1,20,12,"import-test","size","","",18,"package-weight","home","promotion",22,"default","2018-07-01 00:00:00"

johnnatan
Posts: 4
Joined: 01 Jun 2018, 00:11

Re: CSV Import works ok until I add stock fields. [SOLVED][F

Post by johnnatan » 04 Jun 2018, 06:48

I guys

I answer this question reading after read a little more. and after Mr aimeos user suggestions !!! Thanks a lot !!

I just added 'mapping'=> array( and closed. Finally Works !!

Thanks for your time and paticence..

Have all a Nice Day !!!

This is the file if someone needs it
'controller' => [
'jobs' => [
'product' => [
'import' => [
'csv' => [
'location' => '/tmp/csv',
'container' => [
'type' => 'Directory',
'content' => 'CSV',
],
'mapping'=> array(

'item' => array(
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' => array(
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' => array(
8 => 'media.url', // relative URL of the product image on the server
),
'price' => array(
9 => 'price.currencyid', // three letter ISO currency code
10 => 'price.quantity', // the quantity the price (for block pricing)
11 => 'price.value', // price with decimals separated by a dot
12 => 'price.taxrate', // tax rate with decimals separated by a dot
),
'attribute' => array(
13 => 'attribute.code', // code of an attribute, will be created if not exists
14 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
),
'product' => array(
15 => 'product.code', // e.g. EAN code of another product
16 => 'product.lists.type', // e.g. "suggestion" for suggested product
),
'property' => array(
17 => 'product.property.value', // arbitrary value for the corresponding type
18 => 'product.property.type', // e.g. "package-weight"
),
'catalog' => array(
19 => 'catalog.code', // e.g. Unique category code
20 => 'catalog.lists.type', // e.g. "promotion" for top seller products
),
'stock' => array(
21 => 'stock.stocklevel', // Integer
22 => 'stock.type', // the importer knows with type/warehouse your stock belongs to ("default" if you only have one).
23 => 'stock.dateback', // Returning date of item
),
)
],
],
],
],
],


CSV FILE USED
"job_csv_test","job csv test product","default",1,"short","short description","long","long description","path/to/image.jpg","USD",1,20,12,"import-test","size","","",18,"package-weight","home","promotion",22,"default","2018-07-01 00:00:00"

Post Reply