CSV Import - Products

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
bouuman
Posts: 25
Joined: 17 Feb 2020, 18:37

CSV Import - Products

Post by bouuman » 18 Feb 2020, 10:02

Hello im new here

i made a demo shop setup and want to import my products
but i dont understand how to do that :?
as far i understand i have to setup a sheduler job "product import csv" to do the import.
where do i have to put this configuration?:
controller/jobs/product/import/csv/location = <absolute path to the directory with the file>
controller/jobs/product/import/csv/skip-lines = 1
in sheduler also?

the csv setup configuration is stored here right?
/httpdocs/typo3conf/ext/aimeos/Resources/Private/Extensions/ai-controller-jobs/controller/common/src/Controller/Common/Product/Import/Csv/base.php

if i am wrong... can someone write me a small explanation how to do that, where to insert the configuration lines, where to store the csv file and so on... i tryed to read the documentation but i dont understand where i have to do this configurations
and how to execute the import.


I would be very thankful if someone could write a small guide (maybe some screenshots also)

Thank you

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

Re: CSV Import - Products

Post by aimeos » 18 Feb 2020, 17:19

bouuman wrote: 18 Feb 2020, 10:02 where do i have to put this configuration?:
controller/jobs/product/import/csv/location = <absolute path to the directory with the file>
controller/jobs/product/import/csv/skip-lines = 1
in sheduler also?
In the scheduler task you add for the product import, there's a TSConfig field at the bottom. There you have to enter the configuration that should be available for the import. Remember, that TypoScript has a slightly different syntax:

Code: Select all

controller.jobs.product.import.csv.location = /path/to/your/directory/with/csv/files
bouuman wrote: 18 Feb 2020, 10:02 the csv setup configuration is stored here right?
/httpdocs/typo3conf/ext/aimeos/Resources/Private/Extensions/ai-controller-jobs/controller/common/src/Controller/Common/Product/Import/Csv/base.php
There's the default configuration. You can also add a custom configuration in the TSConfig field, e.g.

Code: Select all

controller.jobs.product.import.csv.mapping {
	item {
		0 = product.code
	}
	media {
		1 = media.url
	}
}
bouuman wrote: 18 Feb 2020, 10:02 I would be very thankful if someone could write a small guide (maybe some screenshots also)
We explain what you have to do an you write the guide afterwards. Deal? :-)
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

bouuman
Posts: 25
Joined: 17 Feb 2020, 18:37

Re: CSV Import - Products

Post by bouuman » 18 Feb 2020, 20:52

delete
Last edited by bouuman on 19 Feb 2020, 21:32, edited 1 time in total.

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

Re: CSV Import - Products

Post by aimeos » 19 Feb 2020, 08:01

If you use Zip files, your configuration must be e.g.:

Code: Select all

controller.jobs.product.import.csv.container.type = Zip
controller.jobs.product.import.csv.container.content = CSV
controller.jobs.product.import.csv.location = /httpdocs/csvfiles/product.zip
Important is that the location contains the ZIP file name.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

bouuman
Posts: 25
Joined: 17 Feb 2020, 18:37

Re: CSV Import - Products

Post by bouuman » 19 Feb 2020, 10:29

delete
Last edited by bouuman on 19 Feb 2020, 21:31, edited 3 times in total.

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

Re: CSV Import - Products

Post by aimeos » 19 Feb 2020, 16:24

In the admin interface is a "Log" panel available (extended left navigation bar) where you can see everything that has happened.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

bouuman
Posts: 25
Joined: 17 Feb 2020, 18:37

Re: CSV Import - Products

Post by bouuman » 19 Feb 2020, 17:29

delete

bouuman
Posts: 25
Joined: 17 Feb 2020, 18:37

Re: CSV Import - Products

Post by bouuman » 19 Feb 2020, 21:48

ok the import works, here is a small guide:
1. make a Scheduler Task Class "Aimeos Shop advanced scheduler (aimeos)" ...Jobs "Product import CSV" like in the screenshot below.

2. use this TypoScript configuration:

TypoScript configuration:

controller.jobs.product.import.csv.skip-lines = 1
controller.common.product.import.csv.separator = ,
controller.jobs.product.import.csv {
container.type = Directory
location = /var/www/vhosts/abc123.server.name12.de/httpdocs/csvfiles/
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

}

catalog {

13 = catalog.code

14 = catalog.lists.type

}

stock {

15 = stock.stocklevel

16 = stock.type

17 = stock.typeid

18 = stock.dateback
}

}
}

3. create a csv file with your products formated like this "id","name","type","status"......
Example: (copy+paste the csv example in a textfile and save the textfile as products.csv (convert the csv file into UTF8 with help of notepad++ for example if you have product names with letter äöü or other strange letters ;) )):

csv file:
"product.code","product.label","product.type","product.status","text.type","text.content","text.type","text.content","media.url","price.currencyid","price.quantity","price.value","price.taxrate","catalog.code","catalog.lists.type","stock.stocklevel","stock.type","stock.typeid","stock.dateback"
"9998","9998 - name of the Product 1","default","1","name","9998 - name of the Product 1","long","9998 - name of the Product 1","path_to_the_image.jpg","EUR","1","3.5","19.00","Existing Category 1","default","","","default",""
"9999","9999 - name of the Product 2","default","1","name","9999 - name of the Product 2","long","9999 - name of the Product 2","path_to_the_image.jpg","EUR","1","7.2","19.00","Existing Category 2","default","","","default",""

4. put the csv file into the configured folder on your fileserver /var/www/vhosts/abc123.server.name12.de/httpdocs/csvfiles/

5. Execute the Sheduler Task (press play button)

Screenshot of the backend configuration:
Attachments
guidetypo3gui.png
guidetypo3gui.png (82.24 KiB) Viewed 1139 times

User avatar
SinanSakic
Posts: 2
Joined: 04 May 2021, 07:14

Re: CSV Import - Products

Post by SinanSakic » 04 May 2021, 07:27

Hello,

it still doesn't work for me.
I work with Typo3 on localhost.
I think the absolute path is wrong, but it doesn't have to be.
After I start the scheduler manually, a green bar appears with
"Executed: Aimeos Shop scheduler (aimeos) "and no entry in the log file.
Where could I look for the mistake?

I place the upload-file in:
C:/xampp/htdocs/gourmets/uploads

What is the right absolute path to the file now?

My vhost.conf:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/gourmets"
ServerName gourmets.localhost
<Directory "C:/xampp/htdocs/gourmets">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order Deny,Allow
Allow from all
Require all granted
</Directory>
</VirtualHost>

httpd.conf
DocumentRoot "C:/xampp/htdocs/gourmets"
<Directory "C:/xampp/htdocs/gourmets">

/etc/hosts file:

127.0.0.1 gourmets.localhost

Thank you to All, also previous posts.

User avatar
SinanSakic
Posts: 2
Joined: 04 May 2021, 07:14

Re: CSV Import - Products

Post by SinanSakic » 04 May 2021, 09:09

And if I try with following TS Code:

controller.jobs.product.import.csv.skip-lines = 1
controller.common.product.import.csv.separator = ,
controller.jobs.product.import.csv {
container.type = Directory
location =C:\xampp\htdocs\gourmets\uploads\

mapping {
item {

0 = product.code
.
.
.

I got this log info in Aimeos-area:

Product import error: Required configuration for "controller/jobs/product/import/csv/location" is missing

Post Reply