[solved] product/import/csv catalog not set

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!
tyteck
Posts: 8
Joined: 23 Apr 2020, 19:22

[solved] product/import/csv catalog not set

Post by tyteck » 23 Apr 2020, 19:45

First of all, Hi ! And thanks for your work.

OS : Ubuntu 18.04
Laravel : 6
package : "aimeos/aimeos-laravel": "~2019.10",

My point : importing Products with their categories.

I'm currently migrating a customer shop to aimeos and I've a lot of data to import.
I'm doing it with the csv import right now and my problem is that products are inserted in db, catalog seems to be too but on the admin interface/product page/catalog the is nothing.

My mapping. I made it simple to try import without any success.

Code: Select all

'controller' => [
        'jobs' => [
            'product' => [
                'import' => [
                    'csv' => [
                        'location' => storage_path('import/products'),
                        'skip-lines' => 1,
                        '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)
                            ],
                            'catalog' => [
                                4 => 'catalog.code', // e.g. Unique category code
                                5 => 'catalog.lists.type', // e.g. "promotion" for top seller products
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],
    
Here is the screenshot of the categories(to show there are already there)
admin-catalog.jpg
admin-catalog.jpg (27.53 KiB) Viewed 1267 times
Here is the Test Csv file I'm using for my tests.

Code: Select all

"original id","label","type","status","catalog.code","catalog.lists.type"
"23666","Marie Claire","default","1","parcs",
Import is running fine but when I'm checking the product catalogs, nothing appear.
admin-product-catalog.jpg
admin-product-catalog.jpg (19.41 KiB) Viewed 1267 times
When I set a catalog/category manually everything is fine but with the product/import/csv nothing appear.
What am I doing wrong ?

PS : I checked in DB and product seem linked too ... I'm kinda lost :)
db-product-seem-linked-to-parc.jpg
db-product-seem-linked-to-parc.jpg (47.34 KiB) Viewed 1267 times
PS In the documentation it is said that I can add a product to many categories with csv import but It is missing an example. Should I change the mapping to set another column 'catalog.code' ?
Should I duplicate the whole line with another 'catalog.code' ?

Thanks for any help
Last edited by tyteck on 27 Apr 2020, 08:46, edited 1 time in total.

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

Re: product/import/csv catalog not set

Post by aimeos » 25 Apr 2020, 08:13

Either add "default" for the last column or remove the "catalog.lists.type" mapping. As it's empty, the type isn't found and adding the product to the category skipped.

To add several categories for one product, you can either put several catalog codes in one column using newlines as separator, e.g.

Code: Select all

"cat1
cat2
cat4"
or you maybe can configure more than one column for catalog.code (has to be tested if that doesn't overwrite the first one).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

tyteck
Posts: 8
Joined: 23 Apr 2020, 19:22

Re: product/import/csv catalog not set

Post by tyteck » 27 Apr 2020, 08:46

I didn't try to add several catalog code but the solution with "\n" separated catalogs + "default" catalog.lists.type is solving my problem.
Thanks for the answer :)

Post Reply