csv import of (public) download files

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!
columbo
Advanced
Posts: 124
Joined: 09 Oct 2019, 09:42

csv import of (public) download files

Post by columbo » 07 Sep 2020, 10:25

Hi,

we have to add additional pdf documents (datasheets, specifications etc.) to our products.
These documents should be available for download without any purchase / order.

We are using "Product" > "Media" Type: "Download" - correct, or any other / better options?

As we receive product data from another system than the pdf docs:
Is it possible to create 2 separate csv import files?
  • daily: csv with product data (price, stock, desc. etc.)
  • weekly: csv with URLs to download-files
Currently all docs are removed after the (daily) product file has been processed

thanks

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

Re: csv import of (public) download files

Post by aimeos » 08 Sep 2020, 15:08

columbo wrote: 07 Sep 2020, 10:25 We are using "Product" > "Media" Type: "Download" - correct, or any other / better options?
That's correct.
columbo wrote: 07 Sep 2020, 10:25 Currently all docs are removed after the (daily) product file has been processed
You can use:

Code: Select all

controller/common/product/import/csv/processor/media/listtypes = ['default']
to update only the images by your product CSV import and can configure a second import with

Code: Select all

controller/common/product/import/csv/processor/media/listtypes = ['download']
Here's the code:
https://github.com/aimeos/ai-controller ... hp#L54-L73
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

columbo
Advanced
Posts: 124
Joined: 09 Oct 2019, 09:42

Re: csv import of (public) download files

Post by columbo » 16 Sep 2020, 21:21

I updated my shop.php as follows, but download-medias (pdf files etc.) are removed after each csv-import:

Code: Select all

'controller' => [
	'common' => [
		'product' => [
			'import' => [
				'csv' => [
					'processor' => [
						'media' => [
							'listtypes' => array( 'default' ),
						],
					],
				],
			],
		],
		....

could you please give an example how the csv mapping (in shop.php) has to look like for the default media (image picture), and download media (download file) imports?

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

Re: csv import of (public) download files

Post by aimeos » 18 Sep 2020, 07:56

Either the array_flip() is too much here:
https://github.com/aimeos/ai-controller ... rd.php#L90
or the configuration value must be:

Code: Select all

['default' => 'default']
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply