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?
<?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 ?
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.