Mapping and the line in the CSV file are OK. After creating the referenced category and all attribute types, it imports without problems you can execute the job several times without an error:
If there are any errors, you can see them in the madmin_log table.
Code: Select all
'controller' => [
'jobs' => [
'product' => [
'import' => [
'csv' => [
'container' => [
'type' => 'Directory'
],
'location' => base_path('import'),
'skip-lines' => 0,
'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. "short" for short description
7 => 'text.content', // UTF-8 encoded text
8 => 'text.type', // e.g. "short" for short description
9 => 'text.content', // UTF-8 encoded text
10 => 'text.languageid',
11 => 'text.type', // e.g. "short" for short description
12 => 'text.content', // UTF-8 encoded text
13 => 'text.languageid',
14 => 'text.type', // e.g. "short" for short description
15 => 'text.content', // UTF-8 encoded text
16 => 'text.languageid',
17 => 'text.type', // e.g. "short" for short description
18 => 'text.content', // UTF-8 encoded text
19 => 'text.type', // e.g. "short" for short description
20 => 'text.content', // UTF-8 encoded text
21 => 'text.type', // e.g. "short" for short description
22 => 'text.content', // UTF-8 encoded text
23 => 'text.type', // e.g. "short" for short description
24 => 'text.content', // UTF-8 encoded text
25 => 'text.type', // e.g. "short" for short description
26 => 'text.content', // UTF-8 encoded text
27 => 'text.type', // e.g. "short" for short description
28 => 'text.content', // UTF-8 encoded text
29 => 'text.type', // e.g. "short" for short description
30 => 'text.content', // UTF-8 encoded text
31 => 'text.languageid',
32 => 'text.type', // e.g. "short" for short description
33 => 'text.content', // UTF-8 encoded text
34 => 'text.languageid',
35 => 'text.type', // e.g. "short" for short description
36 => 'text.content', // UTF-8 encoded text
37 => 'text.languageid',
38 => 'text.type', // e.g. "short" for short description
39 => 'text.content', // UTF-8 encoded text
40 => 'text.languageid',
41 => 'text.type', // e.g. "short" for short description
42 => 'text.content', // UTF-8 encoded text
43 => 'text.languageid',
44 => 'text.type', // e.g. "short" for short description
45 => 'text.content', // UTF-8 encoded text
46 => 'text.languageid',
47 => 'text.type', // e.g. "short" for short description
48 => 'text.content', // UTF-8 encoded text
49 => 'text.languageid',
50 => 'text.type', // e.g. "short" for short description
51 => 'text.content', // UTF-8 encoded text
52 => 'text.languageid',
53 => 'text.type', // e.g. "short" for short description
54 => 'text.content', // UTF-8 encoded text
55 => 'text.languageid',
56 => 'text.type', // e.g. "short" for short description
57 => 'text.content', // UTF-8 encoded text
58 => 'text.languageid',
59 => 'text.type', // e.g. "short" for short description
60 => 'text.content', // UTF-8 encoded text
],
'media' => [
61 => 'media.type',
62 => 'media.url', // relative URL of the product image on the server
],
'price' => [
//32 => 'price.quantity', // the quantity the price is valid from (for block pricing)
63 => 'price.type',
64 => 'price.value', // price with decimals separated by a dot, no thousand separator
65 => 'price.currencyid',
66 => 'price.taxrate', // tax rate with decimals separated by a dot
],
'attribute' => [
67 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
68 => 'attribute.code', // code of an existing attribute, new ones will be created automatically
69 => 'attribute.label',
70 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
71 => 'attribute.code', // code of an existing attribute, new ones will be created automatically
72 => 'attribute.label',
73 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
74 => 'attribute.code', // code of an existing attribute, new ones will be created automatically
75 => 'attribute.label',
76 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
77 => 'attribute.code', // code of an existing attribute, new ones will be created automatically
78 => 'attribute.label',
79 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
80 => 'attribute.code', // code of an existing attribute, new ones will be created automatically
81 => 'attribute.label',
82 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
83 => 'attribute.code', // code of an existing attribute, new ones will be created automatically
84 => 'attribute.label',
85 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
86 => 'attribute.code', // code of an existing attribute, new ones will be created automatically
87 => 'attribute.label',
88 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
89 => 'attribute.code', // code of an existing attribute, new ones will be created automatically
90 => 'attribute.label',
91 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
92 => 'attribute.code', // code of an existing attribute, new ones will be created automatically
93 => 'attribute.label',
94 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
95 => 'attribute.code', // code of an existing attribute, new ones will be created automatically
96 => 'attribute.label',
97 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
98 => 'attribute.code', // code of an existing attribute, new ones will be created automatically
99 => 'attribute.label',
100 => 'attribute.type', // e.g. "size", "length", "width", "color", etc.
101 => 'attribute.code', // code of an existing attribute, new ones will be created automatically
102 => 'attribute.label',
],
/*
'product' => [
14 => 'product.code', // e.g. EAN code of another product
15 => 'product.lists.type', // e.g. "suggestion" for suggested product
],
'property' => [
16 => 'product.property.value', // arbitrary value for the corresponding type
17 => 'product.property.type', // e.g. "package-weight"
],
*/
'catalog' => [
103 => 'catalog.code', // e.g. Unique category code
//19 => 'catalog.lists.type', // e.g. "promotion" for top seller products
],
'stock' => [
104 => 'stock.stocklevel', // e.g. Unique category code
],
]
]
]
]
]
],