Page 2 of 4

Re: CSV Product Import not working

Posted: 09 Oct 2017, 11:19
by Innonic
aimeos wrote:We've updated the product CSV file and the required mapping in the Wiki:
https://aimeos.org/docs/Developers/Cont ... lt_mapping
Thank you for this information. I updated my mapping and the CSV but I keep getting this error:

Code: Select all

Not imported: Array(    
[0] => job_csv_test
[1] => job csv test product
[2] => default
[3] => 1
)

Not imported: Array(
[0] => job_csv_test2
[1] => job csv test 2. product
[2] => select
[3] => 1
)
What is that message supposed to tell me except there's no import?

Re: CSV Product Import not working

Posted: 10 Oct 2017, 10:16
by aimeos
Your mapping is still not correct for the example file. You need exactly the same mapping as described in the documentation: https://aimeos.org/docs/Developers/Cont ... lt_mapping

Also, make sure that you've configured https://aimeos.org/docs/Configuration/C ... skip-lines with value "1" to skip the first line as stated in the docs because in the example file this is the header line.

Re: CSV Product Import not working

Posted: 10 Oct 2017, 12:09
by Innonic
I wrote, that I adapted the mapping:

Code: Select all

plugin.tx_aimeos {
settings {
controller.jobs.product.import.csv {
location = [...]/fileadmin/import
mapping {
item {
0 = product.code
1 = product.label
2 = product.type
3 = product.status
}
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
20 = catalog.lists.type
}
}
}
}
}
And from the beginning on, I deleted the first line in the CSV, which means I don't have to skip it. This is my complete CSV:

Code: Select all

"job_csv_test","job csv test product","default",1,"short","short description","long","long description","[...]/fileadmin/import_img/spice-2546147.jpg","EUR",1,"10.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","[...]/fileadmin/import_img/spice-2546147.jpg","EUR",1,"10.00","20.00",,,"job_csv_test","default","1.50","package-weight",,
So these two reasons are not responsible or did I do something wrong here?

Re: CSV Product Import not working

Posted: 10 Oct 2017, 20:11
by aimeos
Hm, both look OK and I ran a successful CSV file import with the same mapping and file (dev-master in my case).
Are the "Not imported: Array( ... )" messages the only error in the madmin_log table?

Re: CSV Product Import not working

Posted: 10 Oct 2017, 21:03
by Innonic
Yes, these are the only error messages after running the import task.

Maybe, as additional info:
I'm using Typo3 6.2.15 and Aimeos 16.10.5.
Could I have a problem with these versions?

I see, there's an update. Do I have to run it? Can I do that without any risk?

Re: CSV Product Import not working

Posted: 11 Oct 2017, 22:38
by aimeos
TYPO3 6.2.15 is extremely old and there's no support any more for this version. You should upgrade nevertheless to avoid security breaches. For updating Aimeos it depends how much you customized the shop. Version 2017.x has some incompatible changes to 2016.10.5 so your required time may vary.

We've tried to import the two CSV lines using your mapping. It worked, even if the logs contain the two "Not imported" messages ...

Re: CSV Product Import not working

Posted: 28 Jul 2021, 12:44
by vishal_thakur
Innonic wrote: 05 Oct 2017, 20:09 After reading through this and other threads again and again I came to the conclusion that it MUST be the path that is wrong. So I checked with my provider and indeed, for the cronjobs I had to use an absolute path I hadn't tried yet.
I'm so sorry for bothering you with that, but I had no clue. The experience is growing and hopefully I won't bother you again with such dumb stuff.

So I got a step further and now I get at least some error messages like:

Code: Select all

Unable to import product with code "job_csv_test": No type item for "product/import-test" in "attribute/type" found
Unable to import product with code "job_csv_test2": Executing statement "
			INSERT INTO "mshop_price" (
				"siteid", "typeid", "currencyid", "domain", "label",
				"quantity", "value", "costs", "rebate", "taxrate", "status",
				"mtime", "editor", "ctime"
			) VALUES (
				1, '3', NULL, 'product', ' 10.00', 1, '10.00', '0.00', '0.00', '20.00', 1, '2017-10-05 22:20:04', 'scheduler', '2017-10-05 22:20:04'
			)
		" failed: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'currencyid' cannot be null
Shouldn't that work with your example file? Maybe I can figure out the problem myself now, but your help would be appreciated.

can i know, how you are importing the product from csv file?
for example ::
here is my csv file location : aimeos-project/tmp/products-import-example.csv
do we need to execute any controller function to import this file?
here is the screenshot where i have execute command ==>
php aimeos1/tmp/products-import-example.csv aimeos:jobs "product/import/csv"
in server : https://prnt.sc/1h2dhw1

Re: CSV Product Import not working

Posted: 29 Jul 2021, 05:23
by aimeos
Required configuration in your ./config/shop.php:

Code: Select all

'controller' => [
	'jobs' => [
		'product' => [
			'import' => [
				'csv' => [
					'location' => basepath( 'tmp' )
				]
			]
		]
	]
],
See here for reference:
- https://aimeos.org/docs/2021.x/config/c ... /#location
- https://aimeos.org/docs/2021.x/cronjobs ... and-format

Command you need to execute:

Code: Select all

php artisan aimeos:jobs "product/import/csv"

Re: CSV Product Import not working

Posted: 29 Jul 2021, 06:14
by vishal_thakur
after adding file location in ./config/shop.php file
i'm getting this error : Could not open input file: aimeos:jobs
https://prnt.sc/1hgvass

Re: CSV Product Import not working

Posted: 29 Jul 2021, 06:33
by aimeos
Sorry, the correct command is:

Code: Select all

php artisan aimeos:jobs "product/import/csv"