CSV import - what is the limit of characters?

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!
Dochr
Posts: 8
Joined: 03 Nov 2021, 17:18

CSV import - what is the limit of characters?

Post by Dochr » 16 Feb 2022, 10:56

Laravel version: 8.80
Aimeos version: 2021.10
PHP version: 8.0.8

When importing file via CSV, I am sometimes getting the following error:

"2022-02-14 23:22:48 import/csv/product 3
Unable to import product with code "14150742pca": Code is too long"

I have a suspicion that this is due to the length of the text field, but I am not certain.
What are the limits of characters for csv importer?


Two records: One failed the import, another passed:

FAILED:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
14150742pca,Koszula casualowa o kroju regular fit z bawełny ekologicznej model ‘Clayton’,"Koszula casualowa męska SELECTED HOMME, Czysta bawełna ekologiczna , Krój regular fit, Tkany wzór, Kołnierzyk typu under button down , Długie rękawy, Listwa guzikowa , Sportowe mankiety , Długość tyłu w rozmiarze M: 78 cm, Szerokość ramion w rozmiarze M: 45 cm, Długość rękawa w rozmiarze M: 65 cm",https://www.awin1.com/pclick.php?p=3062 ... g",Koszula casualowa o kroju regular fit z bawełny ekologicznej model ‘Clayton’ > Odzież,,,219.99,Peek & Cloppenburg,https://www.peek-cloppenburg.pl/selecte ... 4,Selected Homme,1,,,,,,,blue,100% Bawełna (bio),,,,,,,Mężczyzna / Odzież / Koszule / na co dzień,,PLN,short,default,select,aw_deep_link,product_category,merchant_product_category_path,base_price,merchant_name,merchant_deep_link,brand_name,number_available,badge,discount_code,ean,dimensions,colour,Fashion:material,style,pattern,simple_tags,aw_product_id,merchant_product_id,mpn,"1415074212pca
1415074213pca
1415074214pca
1415074215pca
1415074216pca",default,color,default,size,,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,14150742,model_color ,141507,model
PASSED:,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
13135342pca,T-shirt z bawełny ekologicznej model ‘Colman’,"T-shirt męski SELECTED HOMME , Czysta bawełna ekologiczna , Krój relaxed fit, Okrągły dekolt , Detal z logo, Długość tyłu w rozmiarze XXL: 76 cm",https://www.awin1.com/pclick.php?p=2837 ... ",,T-shirt z bawełny ekologicznej model ‘Colman’ > Odzież,,,119.99,Peek & Cloppenburg,https://www.peek-cloppenburg.pl/selecte ... 4,Selected Homme,1,,,,,,,blue,100% Bawełna (bio),,UNI,,,,,Mężczyzna / Odzież / Koszulki / T-shirty,,PLN,short,default,select,aw_deep_link,product_category,merchant_product_category_path,base_price,merchant_name,merchant_deep_link,brand_name,number_available,badge,discount_code,ean,dimensions,colour,Fashion:material,style,pattern,simple_tags,aw_product_id,merchant_product_id,mpn,"1313534212pca
1313534213pca
1313534214pca
1313534215pca
1313534216pca",default,color,default,size,,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,hidden,0,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,13135342,model_color ,131353,model


Relevant part of shop.php:

Code: Select all

'controller' => [
		'jobs'=> [
			'product' => [
				'import' => [
					'csv' => [
						'location' => './storage/csv_import',
						'skip-lines' => 1,
						'strict' => 0,
						'mapping' => [
							'item' => [
								0 => 'product.code', // fa_product_id
								1 => 'product.label', // UTF-8 encoded text, also used as product name //product_name
								33 => 'product.type', // type of the product, e.g. "default" or "selection"
								13 => 'product.status', // enabled (1) or disabled (0) // in_stock
							],
							'text' => [
								31 => 'text.type', // e.g. "short" for short description //text_type
								2 => 'text.content', // UTF-8 encoded text //description
								34 => 'text.type', //aw_deep_link_label
								3 =>  'text.content', //aw_deep_link
							],
							'media' => [
								4 => 'media.url', //merchant_image_url
								59 => 'media.label', //Media Title
								5 => 'media.url', //alternate_image
							],
							'price' => [
								30 => 'price.currencyid', // three letter ISO currency code // currency_id
								9 => 'price.value', // price with decimals separated by a dot // search_price
								74 => 'price.rebate', // diffference between base_price and search_price
							],
							'stock' => [
								14 => 'stock.stocklevel',
							],
							'attribute' => [
								55 => 'product.lists.type', // For variant attributes "variant" otherwise "default"
								56 => 'attribute.type', // fa_colour
								29 => 'attribute.code', // fa_colour value
								57 => 'product.lists.type', // For variant attributes "variant"
								58 => 'attribute.type', // size
								18 => 'attribute.code', // size value
								61 => 'product.lists.type', //hidden - makes the attribute hidden
								35 => 'attribute.type', //product_category_label
								6 =>  'attribute.code', //product_category
								62 => 'product.lists.type', //hidden - makes the attribute hidden
								7 =>  'attribute.code', //merchant_product_category_path
								36 => 'attribute.type', //merchant_product_category_path_label
								63 => 'product.lists.type', //hidden - makes the attribute hidden
								10 => 'attribute.code', //merchant_name
								38 => 'attribute.type', //merchant_name_label
								64 => 'product.lists.type', //hidden - makes the attribute hidden
								11 => 'attribute.code', //merchant_deep_link
								39 => 'attribute.type', //merchant_deep_link_label
								65 => 'product.lists.type', //hidden - makes the attribute hidden
								16 => 'attribute.code', //badge
								42 => 'attribute.type', //badge_label
								66 => 'product.lists.type', //hidden - makes the attribute hidden
								17 => 'attribute.code', //discount_code
								43 => 'attribute.type', //discount_code_label
								67 => 'product.lists.type', //hidden - makes the attribute hidden
								15 => 'attribute.code', //ean
								44 => 'attribute.type', //ean_label
								68 => 'product.lists.type', //hidden - makes the attribute hidden
								19 => 'attribute.code', //dimensions
								45 => 'attribute.type', //dimensions_label
								69 => 'product.lists.type', //hidden - makes the attribute hidden
								20 => 'attribute.code', //colour
								46 => 'attribute.type', //colour_label
								70 => 'product.lists.type', //hidden - makes the attribute hidden
								22 => 'attribute.code', //style
								48 => 'attribute.type', //style_label
								71 => 'product.lists.type', //hidden - makes the attribute hidden
								25 => 'attribute.code', //aw_product_id
								51 => 'attribute.type', //aw_product_id_label
								72 => 'product.lists.type', //hidden - makes the attribute hidden
								26 => 'attribute.code', //merchant_product_id
								52 => 'attribute.type', //merchant_product_id_label
								73 => 'product.lists.type', //hidden - makes the attribute hidden
								27 => 'attribute.code', //mpn
								53 => 'attribute.type', //mpn_label
							],
							'product' => [
								54 => 'product.code', // for selection - variants separated by newline - fa_product_id 
								75 => 'product.code', //suggestion product1
								76 => 'product.lists.type', //suggestion
								77 => 'product.code', //suggestion product2
								78 => 'product.lists.type', //suggestion
								79 => 'product.code', //suggestion product3
								80 => 'product.lists.type', //suggestion
								81 => 'product.code', //suggestion product4
								82 => 'product.lists.type', //suggestion
								83 => 'product.code', //suggestion product5
								84 => 'product.lists.type', //suggestion
								85 => 'product.code',//stylization product1
								86 => 'product.lists.type', //stylization 1
								87 => 'product.code', //stylization product2
								88 => 'product.lists.type', //stylization 1
								89 => 'product.code',//stylization product3
								90 => 'product.lists.type', //stylization 1
								91 => 'product.code',//stylization product4
								92 => 'product.lists.type', //stylization 1
								93 => 'product.code',//stylization product1
								94 => 'product.lists.type', //stylization 2
								95 => 'product.code',//stylization product2
								96 => 'product.lists.type', //stylization 2
								97 => 'product.code',//stylization product3
								98 => 'product.lists.type', //stylization 2
								99 => 'product.code',//stylization product4
								100 => 'product.lists.type', //stylization 2
							],
							'property' => [
								8 => 'product.property.value', //base_price
								37 => 'product.property.type', //base_price_label
								12 => 'product.property.value', //brand_name
								40 => 'product.property.type', //brand_name_label
								21 => 'product.property.value', //Fashion:material
								47 => 'product.property.type', //Fashion:material_label
								23 => 'product.property.value', //pattern
								49 => 'product.property.type', //pattern_label
								24 => 'product.property.value', //simple_tags
								50 => 'product.property.type', //simple_tags_label
							],
							'catalog' => [
								28 => 'catalog.code', // e.g. Unique category code //fa_taxonomy
								32 => 'catalog.lists.type', // e.g. "promotion" for top seller products //lists_type
							],
						],
					],
				],

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

Re: CSV import - what is the limit of characters?

Post by aimeos » 17 Feb 2022, 16:31

The maximum number of characters for codes is 64 bytes.
The problem is not the product code but maybe one of the attribute codes.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply