1

I have two product XML look like:

1:- product-1.xml

 .

 .

 .

 .

 <images merge-mode="add">

      <image-group view-type="large">

           <image path="product-123.jpg" />

      </image-group>

 </images>

 .

 .

2:- product-1-1.xml

 .

 .

 .

 .

 <images merge-mode="add">

      <image-group view-type="large">

           <image path="product-124.jpg" />

           <image path="product-125.jpg" />

      </image-group>

 </images>

 .

 .

I am importing both the files and I want to append the images for the same product (PRODUCT123) as

 <images merge-mode="add">

      <image-group view-type="large">

           <image path="product-123.jpg" />

           <image path="product-124.jpg" />

           <image path="product-125.jpg" />

      </image-group>

 </images>

but it's not appending the images.

I used merge-mode="merge" also for the same but not getting the result as I expected.

Could anyone help me out that where I am doing wrong?

Zlatin Zlatev
  • 3,034
  • 1
  • 24
  • 32

2 Answers2

2

Sadly, what you want to achieve is currently not supported by the Salesforce B2C Commerce platform. You cannot split the images of an image group into several files and expect that they will be merged. Indeed, the file import mode should be MERGE, but what you have tried as element merge-mode="add" is not supported, and you should have received a warning when you have imported the file.

If you look at catalog.xsd schema from the documentation you would see the following under complexType.Product.Images type definition:

    <xsd:attribute name="merge-mode" type="simpleType.MergeMode" default="merge" use="optional">
        <xsd:annotation>
            <xsd:documentation>
                Used to control if specified image groups will be merged to or replace the existing image specification.
                The values "merge" and "replace" are the only ones supported for the "merge-mode" attribute.
                Attribute should only be used in import MERGE and UPDATE modes. In import REPLACE mode, using the "merge-mode" attribute is not
                sensible, because existing image groups will always be removed before importing the image groups
                specified in the import file.
            </xsd:documentation>
        </xsd:annotation>
    </xsd:attribute>

P.S. I would suggest that you look for an alternative solution for merging the data about images before sending it to Salesforce B2C Commerce instance.

Zlatin Zlatev
  • 3,034
  • 1
  • 24
  • 32
  • 1
    Generally, 'image mapping' jobs would write out all the images currently assigned to a product (if it exists) and adds the new ones to the end of the collection. – sholsinger Apr 11 '19 at 15:51
1

Are you using ImportCatalog pipelet? Please check job configuration, import mode should be MERGE.

Netinel
  • 101
  • 1
  • 2