Complement products

For every product we can assign a list of complement products. The complements are displayed in Shoppa when the base product is displayed and can be automatically assigned to templates to easily build multi-product signs.

Note: Just because product A assigns product B as a complement does not mean the opposite is true. You must explicitly assign all relationships you want to use.

Adding two complement products

Lets assign a complement product to our sample product:

<mediablob customerID="1143" customerIDType="ShoppaID" createDate="2018-05-12T00:00:00" schemaVersion="1.7" xmlns="http://shoppa.com/mediablobSchema">
  <products>
    <product id="65467-14" idType="Code1">
      <complementProducts>
        <complementProduct id="65468-1" idType="Code1" />
        <complementProduct id="65468-3" idType="Code1" />
      </complementProducts>
    </product>
  </products>
</mediablob>

You can of course assign complement products at the same time you create your product or modify other properties of it. The only requirement is that the complement product already exists in Mediablob.

Replacing existing complements

If you send a <complementProducts /> list as above, the new complements will be merged with any existing complements and make the list of complements longer. If you instead want to replace the existing complements with a new list, you need to set replace="true":

<mediablob customerID="1143" customerIDType="ShoppaID" createDate="2018-05-12T00:00:00" schemaVersion="1.7" xmlns="http://shoppa.com/mediablobSchema">
  <products>
    <product id="65467-14" idType="Code1">
      <complementProducts replace="true">
        <complementProduct id="65468-1" idType="Code1" />
      </complementProducts>
    </product>
  </products>
</mediablob>

The above xml effectively deletes complement 65468-3, since it is no longer part of the list.

Deleting all complements for a product

If you want to delete all existing complements for a product, you set delete="true" on the <complementProducts /> section:

<mediablob customerID="1143" customerIDType="ShoppaID" createDate="2018-05-12T00:00:00" schemaVersion="1.7" xmlns="http://shoppa.com/mediablobSchema">
  <products>
    <product id="65467-14" idType="Code1">
      <complementProducts delete="true" />
    </product>
  </products>
</mediablob>

Note that deleting the complements list does not delete the product itself.

Last updated