Selection product not importing properly in CSV Import

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
zaheer
Posts: 19
Joined: 12 Nov 2020, 10:22

Selection product not importing properly in CSV Import

Post by zaheer » 28 Jan 2021, 06:32

I am using Sample CSV file for import.
There are no errors on import and the products are added to tables.
But the variants are not being added. Here are the screen shots.
Frontend.jpg
Frontend.jpg (36.92 KiB) Viewed 1252 times
Variants.jpg
Variants.jpg (54.6 KiB) Viewed 1252 times
My shop.php is :

Code: Select all

	'controller' => [
		'jobs' => [
			'product' => [
				'import' => [
					'csv' => [
						'location' => public_path() . '/tmp',
						'skip-lines' => 1,
						'container' =>[
							'type' => 'Directory',
							'content' => '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',
								5 => 'text.content',
								6 => 'text.type',
								7 => 'text.content',
							],
							'media' => [
								8 => 'media.url',
							],
							'price' => [
								9 => 'price.currencyid',
								10 => 'price.quantity',
								11 => 'price.value',
								12 => 'price.taxrate',
							],
							'attribute' => [
								13 => 'attribute.code',
								14 => 'attribute.type',
							],
							'product' => [
								15 => 'product.code',
								16 => 'product.lists.type',
							],
							'property' => [
								17 => 'product.property.value',
								18 => 'product.property.type',
							],
                            'catalog' => [
                                19 => 'catalog.code', // e.g. Unique category code
                                20 => 'catalog.lists.type', // e.g. "promotion" for top seller products
							],
						],
					],
				]
			]
		]
	],
CSV file is attached.

What I am missing here, please help.
Attachments
products-import-example.zip
(528 Bytes) Downloaded 103 times

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

Re: Selection product not importing properly in CSV Import

Post by aimeos » 29 Jan 2021, 09:43

Did you create the attributes first? The product CSV import doesn't do that automatically if you forgot to add them before.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

zaheer
Posts: 19
Joined: 12 Nov 2020, 10:22

Re: Selection product not importing properly in CSV Import

Post by zaheer » 30 Jan 2021, 07:22

The documentation says that attributes are automatically created.
"Nevertheless, if an attribute doesn't exist, it will be created automatically."

"size" attribute was already added.
"S/M" & "M/L" no. But I also tried adding them. Still same result.
I can see the attributes in list if I try to manually add them.
attributes.jpg
attributes.jpg (62.49 KiB) Viewed 1228 times

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

Re: Selection product not importing properly in CSV Import

Post by aimeos » 30 Jan 2021, 10:36

OK, then it's the missing product.lists.type column for each attribute type/value pair column with the value "variant" so the attributes are added as variant attributes instead of regular attributes. Instead of:

Code: Select all

attribute.type;attribute.code;attribute.type;attribute.code
size;M/L;color;blue
Use:

Code: Select all

product.lists.type;attribute.type;attribute.code;product.lists.type;attribute.type;attribute.code
variant;size;M/L;variant;color;blue
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

zaheer
Posts: 19
Joined: 12 Nov 2020, 10:22

Re: Selection product not importing properly in CSV Import

Post by zaheer » 01 Feb 2021, 06:48

Thanks alot.
Yes, this fixed the issue.

Post Reply