Search code examples
csvprestashopgallerypimcore

Import picture in gallery PIMCORE


I am using a PIMCORE version 6.5, and I would like to import product images via csv.

But the class of my product is of type "gallery" and not simple images.

When I export a test to CSV it gives me a serialized code to encrypt in Base64.

My question is that I only have the local path of my photos, and I would like to import them into my gallery. How do I proceed?


Solution

  • There are various solutions to this problem. What I would do is to write a little PHP Script (e.g. in a controller or a service) for the import.

    1) Copy all your local images into some asset folder path within your Pimcore project

    2) Create the assets via the PHP API: https://pimcore.com/docs/6.x/Development_Documentation/Assets/Working_with_PHP_API.html

    3) Create/update the galleries via the PHP API: https://pimcore.com/docs/6.x/Development_Documentation/Objects/Object_Classes/Data_Types/Image_Types.html

    Not sure why you need a .csv for this import but if you have important information or metadata there just upload it in the controller and use the information within the script in order to create the correct objects.