Get products with missing product image and add image to them

[Question (in english) - remember to come back and check the answer that solves your question to mark it as resolved, formatting of messages with markdown]

Litium version: [6.3.7]

Hi, we’ve had an issue with ProductMediaMapper where it wasn’t configured correctly and as a result our client noticed that everytime they created a new product not all images where uploaded. The field that lies under “Display images” on the variant had an image which is the image that is diplayed on the article page. The image that is displayed in search results or product lists was not, on “Images” tab on the product.

We fixed so that all new products get all the images uploaded correctly but our client had by then added many new products and uploaded images for them. They now want those products to get the product image which is missing without having to upload the images again. Is there a way to search for those products and add the image to them programmatically? The images are already uploaded since they’re present on the variant.

The Litium version is 6.3.7, thanks in advance for any help.

Do you have the source code AddOn or is it Nuget?

It is Nuget. My colleague who installed it mentioned that there was some old code for ProductMediaMapper before we upgraded Litium. Was that the source code maybe but for an older version?

Yes, I will send you the main class from ProductMediaMapper, it will help you figure out and create a logic on what you need to achieve.

Ok, thanks a lot!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.