The media data type associate pictures with a product.
The URL to post media data to is:
https://mis.cdon.com/media
Data Contract
The relevant schema files are the following:
- media.xsd
- types.xsd
The last file is a supplement to the media.xsd, which define the media data structure.
Product Variations
Product elements in the product data type support variations of the same product (e.g. different colors of a product). In the media import, it is possible to assign different media to both the main product and/or the variation products.
Product ID
The media will, of course, be imported to the specified product ID.
If media is added to the main product, this media will be presented when the product page is first displayed to the user. The media added to the variation products will presented when the user selects the variation.
Multi-Variations
In cases where a product variant varies on two attributes at the same time, certain rules apply.
- Size and Color. Color is the predominant variable.
- Size and Flavor. Size is the predominant variable.
This means that the predominant variable’s media will be presented to the user.
Example 1:
A shirt varies on size (e.g. S, M or L) and color (e.g. red or green). When the user has selected the size “M”, the picture displayed will not change until the user selects another color.
Example 2:
A beverage varies on size (e.g. 2 dl, 5 dl or 1 liter) and flavor (e.g. banana or strawberry). When the user has selected the flavor “banana”, the picture displayed will not change until the user selects another size.
Validation Rules
Every product must have exactly one main picture.
Extra pictures are optional.
A maximum of 10 images can be assigned to a product.
Practical Examples
1. If you want the same images (if the variations has different sizes (as you cannot see differences in size in an image)) :
<product> <id>ModelId</id> <images> <main>https://www.image.com/image1.jpg</main> <extra>https://www.image.com/image2.jpg</extra> </images> </product>
2. If you want different images (if the variations has different colors, this layout is only possible to create by file with XML, or if you use API):
<product> <id>VariantId_1</id> <images> <main>https://www.image.com/image3.jpg</main> <extra>https://www.image.com/image4.jpg</extra> </images> </product> <product> <id>VariantId_2</id> <images> <main>https://www.image.com/image5.jpg</main> <extra>https://www.image.com/image6.jpg</extra> </images> </product>
3. When both model product and variations has images (the model product images will be shown first at the site) - this is not recommended:
<product> <id>ModelId</id> <images> <main>https://www.image.com/image1.jpg</main> <extra>https://www.image.com/image2.jpg</extra> </images> </product> <product> <id>VariantId_1</id> <images> <main>https://www.image.com/image3.jpg</main> <extra>https://www.image.com/image4.jpg</extra> </images> </product> <product> <id>VariantId_2</id> <images> <main>https://www.image.com/image5.jpg</main> <extra>https://www.image.com/image6.jpg</extra> </images> </product>
The order in which images will be displayed for VariantId_1:
Model main: https://www.image.com/image1.jpg
Model extra: https://www.image.com/image2.jpg
Variant main: https://www.image.com/image3.jpg
Variant extra: https://www.image.com/image4.jpg
The order in which images will be displayed for VariantId_2:
Model main: https://www.image.com/image1.jpg
Model extra: https://www.image.com/image2.jpg
Variant main: https://www.image.com/image5.jpg
Variant extra: https://www.image.com/image6.jpg