ProductMediaMapper (4.0.1) does not populate _images

Hi!

We are using the ProductMediaMapper for a Customer and it works just fine by populating the properties on the variant. But we are using _images in listing etc and that does not get populated. Is that possible?
If we go to the Images in the back office it is empty and we get no images in our listing. Adding the same image to that list and we have a image in the listing.
Can you configure ProductMediaMapper to add images to the _images property as well?

Thanks!

/Kristoffer

Litium version: 6.3.4

What does your configuration look like?

If you use DisplayImagesMappings it will map images to the _images property.
https://docs.litium.com/documentation/add-ons/product-management/product-media-mapper_1/configure

This is our config:

<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Site/ProductMediaMapper/ProductMediaMapping.xsd"
  mediaarchiverootfolder="ArticleFiles" articlenumbercharacterlengthmatch="1">
  <AllowedFileTypes>
    <AllowedFileType filetype="gif" />
    <AllowedFileType filetype="jpg" />
    <AllowedFileType filetype="png" />
  </AllowedFileTypes>
  <FieldFileMappings>
    <!-- Example match 723049.jpg matches article with number 723049 and file will be connected to the ProductImage1 field of the article.-->
    <FieldFileMapping prefix="" suffix=""  templatefieldname="Image1"/>
    <!-- Example match 723049_1.jpg matches article with number 723049 and file will be connected to the ProductImage2 field of the article.-->
    <FieldFileMapping prefix="" suffix="_1" templatefieldname="Image2"/>
    <!-- Example match 723049_2.jpg matches article with number 723049 and file will be connected to the ProductImage3 field of the article.-->
    <FieldFileMapping prefix="" suffix="_2" templatefieldname="Image3"/>
    <!-- Example match 723049_3.jpg matches article with number 723049 and file will be connected to the ProductImage4 field of the article.-->
    <FieldFileMapping prefix="" suffix="_3" templatefieldname="Image4"/>
    <!-- Example match 723049_4.jpg matches article with number 723049 and file will be connected to the ProductImage5 field of the article.-->
    <FieldFileMapping prefix="" suffix="_4" templatefieldname="Image5"/>
    <!-- Example match 723049_5.jpg matches article with number 723049 and file will be connected to the ProductImage6 field of the article.-->
    <FieldFileMapping prefix="" suffix="_5" templatefieldname="Image6"/>
  </FieldFileMappings>
  <DisplayImagesMappings>
    <DisplayImageMapping prefix="" suffix="_A" prio="1" />
    <!-- Example match 654765_A.jpg matches article with number 654765-->
    <DisplayImageMapping  prefix="" suffix="_B" prio="2" />
    <!-- Example match 654765_B.jpg matches article with number 654765-->
    <DisplayImageMapping prefix="" suffix="_C" prio="3" />
    <!-- Example match 654765_C.jpg matches article with number 654765-->
  </DisplayImagesMappings>
</Configuration>

Any idea why the _images is not populated? Maybe we should remove ?

/Kristoffer

The configuration looks right to me. Are there any errors in the log? Are the file names correct?

I tried this setup just now and it works as expected, meaning I can see the images under the Images tab.

Litium 6.3.6 with ProductMediaMapper 4.0.1. Default configuration.

Base product: 123456
Variants: 123456_V1, 123456_V2

Images:

  • 123456_A.jpg (mapped correctly to base product 123456)
  • 123456_V1_A.jpg (mapped correctly to variant 123456_V1)
  • 123456_V2_A.jpg (mapped correctly to variant 123456_V2)

Hi!
We added this line:

<DisplayImageMapping prefix="" suffix="" prio="1" />

Then the image appeared under Images. Should this be needed?

Thanks!

/Kristoffer

It depends on how the image files are named. If they are named exactly like the article number, then yes, you would need it. Otherwise it’s only looking for articlenumber_A.jpg (example).

Maybe a use case would that the default image is only article number and then each subsequent image is _A, _B, _C, etc. Then you’d need your added line together with the ones from you first post, with adjusted priority.

Ok, thanks. I guess that line wasn’t necessary in 4.8. The problem started after upgrade to 6.

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