Skip to main content
Print

Shopify Mediaupload Field Plugin

The format Send Shopify media uploads images, videos, 3D models and files from the DAM to Shopify. The Shopify station template uses it for all media rows. The setup is on Shopify Transmitter.

Available from: 1.20.0

Configuration of the datamap row

There are two keys, depending on the use case:

mediaUpload|[]upload|[]
Media typesImage, Video, 3D-ModelFile, Image, Video, 3D-Model
Resultmedia of the product (product images, videos, 3D models); variant images are taken from thesefiles in Content > Files, not attached to the product
Uploadedwhile the product is processedbefore the product is processed
Exampleproduct imagePDF that a file metafield refers to
Available fromevery version1.19.8 · 1.20.0

The template has one row per media type: images, videos and 3D models as mediaUpload|[], documents as upload|[]. A collection has one image under the key mediaUpload without |[], see Shopify Collections.

Selecting the format Send Shopify media

Configuration of the format

Select the Media type (1) that this row sends. The source is a DAM reference attribute (or SourceField for the row’s own attribute). As Data for media upload (2), a Loop head builds one entry per file.

Format settings with the media type

The loop context of that loop head is Loop for DAM references (1). Select the export preset in the loop:

Loop over the DAM references with the export preset

Each entry is an array with these values:

KeyValue
filenamethe file name in Shopify; the template uses {mamfileid}-{presetfilename}
exportURLthe URL Shopify downloads the file from
altthe alt text (optional)
lastChangethe modification date of the file
The values of one media entry

A |[] key adds its values once per language. The template’s media rows are therefore only sent for the default language:

Condition: only in the default language
Rows for videos and 3D models
The upload row for files

How media are synchronised

  • Shopify stores no ID from Contentserv: a file is identified by its file name.
  • The export is the complete set of the product’s media. Media that are no longer exported are removed from the product; the files stay in Content > Files.
  • A file is uploaded again only when it was changed in the DAM since the last upload (lastChange).
  • The order of the product media is the export order.
  • Shopify processes videos and 3D models in the background; they can take a moment to appear. A file Shopify cannot process is deleted and uploaded again in the next run.

File names matched exactly, .glb 3D models, 3D models not uploaded again on every export, files Shopify could not process uploaded again: from 1.21.19

Product media in Shopify: images, video and 3D model
Uploaded files in Content > Files

Important:

  • Each file needs a unique name. The pattern {mamfileid}-{presetfilename} ensures that.
  • If Shopify already has a file with the same name, it stores the new one with a suffix (_<id>).
  • External videos (e.g. YouTube) are not supported.

Variant images

A variant has one image, and it must be one of the product’s media. In the variants datamap, the row additionalInformation has the entry mediaFile with the file name of the variant’s image:

The mediaFile entry of the variants datamap
A variant with its image in Shopify

Important: mediaFile must use the same file name pattern and the same export preset as the product’s mediaUpload. A variant image that is not among the exported product media is left unchanged, and the job log says so (from 1.21.20).

Images collected from the variants

If your images are on the variants only, the deactivated row of the previous template collects them into the product media. Each image is added once, in variant order:

  1. The loop context is Loop for Complex Articles: it loops over the variants.
  2. The format of the source value is Loop value (Single value),
  3. with the loop value imageAttribute as source field.
  4. The loop’s product map fills imageAttribute: select the variants’ image attribute there as source.

Together this reads the image attribute of each variant.

Row of the previous template that collects the variant images

Important: use it instead of the product image row, not together with it. Use the same export preset as the variants’ mediaFile and add the condition for the default language, as in the other media rows.

Legacy

Before the format, every media entry was built by hand with Create an array and the keys filename, exportURL, alt, lastChange and type (IMAGE, VIDEO, MODEL_3D, FILE). Such rows keep working.

Was this article helpful?
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents