Skip to main content
Print

Shopify Collections

Collections in Shopify are similar to categories in other shop systems. The transmitter creates them from the structure groups of the sales channel, with the node mapping collectionsUpdateCreate. Most of the configuration works like the product configuration. The setup is on Shopify Transmitter.

Rows of the collections datamap

Collection fields

FieldKeyNote
PIM identifiercustom.pimidrequired, see PIM identifier metafield on Shopify Transmitter
Title, descriptioncollectionInformation|title|{StoreView}, …|descriptionHtml|{StoreView}translated; the title is required
HandlecollectionInformation|handleURL of the collection (/collections/<handle>)
SEO title and description…|seo|title|{StoreView}, …|seo|description|{StoreView}translated
Sort ordercollectionInformation|sortOrderMANUAL, ALPHA_ASC, ALPHA_DESC, BEST_SELLING, CREATED, CREATED_DESC, PRICE_ASC, PRICE_DESC
Theme templatecollectionInformation|templateSuffixthe suffix of collection.<suffix>.json
Rule setcollectionInformation|ruleSetsee Smart collections
ImagecollectionInformation|image|altText|{StoreView}, mediaUploadsee Collection image
Sales channelssalesChannelsee Markets, Sales Channels and Prices
Metafieldsmetafields|…definitions with the owner Collections, see Metafield Field Plugin

Important: structure groups that contain products also have the products as nodes. The node condition of the collections datamap skips these nodes; keep it, or every product becomes a collection of its own (and the second one fails with “Handle has already been taken”).

Products in collections

The products datamap adds each product to its collections with the row collections. It sends the structure groups the product is linked to in the sales channel (format Send value of the SC::Sales Channel table):

The collections row of the products datamap

The list is the product’s complete membership: the product is added to every listed collection, and removed from every other collection the transmitter created. Collections created by hand in Shopify and smart collections are not changed.

Available from: complete membership 1.19.8 · 1.20.0; collections created by hand are left alone from 1.21.19

Products of a manual collection in Shopify

Important:

  • The collections must exist in Shopify first. On an empty shop, export the collections, then the products.
  • The loop’s channel must be the sales channel of the export.

Smart collections

Smart collections are filled by Shopify according to rules, e.g. all products with a certain tag. The row collectionInformation|ruleSet makes a collection a smart collection:

{"appliedDisjunctively": false, "rules": [{"column": "TAG", "relation": "EQUALS", "condition": "summer"}]}

The row is skipped while the attribute with the rule’s value is empty (1), so a collection without a rule stays a manual collection. appliedDisjunctively (2): true = a product has to match any rule, false = all rules. Each rule in rules (3) has the three values: column, relation and condition (4). The template has one rule prepared, with the values from attributes; add more rules as further entries.

The rule set row and its condition
ColumnsRelations
IS_PRICE_REDUCED, PRODUCT_CATEGORY_ID, PRODUCT_CATEGORY_ID_WITH_DESCENDANTS, PRODUCT_METAFIELD_DEFINITION, PRODUCT_TAXONOMY_NODE_ID, TAG, TITLE, TYPE, VARIANT_COMPARE_AT_PRICE, VARIANT_INVENTORY, VARIANT_METAFIELD_DEFINITION, VARIANT_PRICE, VARIANT_TITLE, VARIANT_WEIGHT, VENDORCONTAINS, ENDS_WITH, EQUALS, GREATER_THAN, IS_NOT_SET, IS_SET, LESS_THAN, NOT_CONTAINS, NOT_EQUALS, STARTS_WITH
Conditions of a smart collection in Shopify

Important:

  • A collection cannot switch between manual and smart. Send the rule set when the collection is created: a manual collection cannot get rules later. The rules of a smart collection can be changed with any later export.
  • Products cannot be added to a smart collection directly: Shopify adds them by its rules. The product’s collections row skips smart collections (from 1.19.9 · 1.20.0).
  • In the template the row is only sent while a rule value is set. Without that condition every collection would be created as a smart collection with an empty rule, which Shopify rejects.
  • Shopify fills smart collections in the background: a new product can take a minute to appear.

Collection image

A collection has one image. It needs two rows:

  1. collectionInformation|image|altText|{StoreView}: the alt text. The image is only processed when this row is sent.
  2. mediaUpload (format Send Shopify media, type IMAGE): one image, not a list. If the attribute holds several files, the first one is used.
The image rows of the collections datamap

The file is uploaded to Content > Files and then set as the collection image. File names work as for product media, see Shopify Mediaupload Field Plugin.

Important: a collection image needs an alt text. Without one, remove the condition from the alt text row and switch on “deliver if empty”.

Removing the collection image

The deactivated row collectionInformation|image of the previous template sends an empty image, which removes the image from the collection. Use it instead of the two image rows, never together with them. The file stays in Content > Files.

Row of the previous template that removes the collection image

The previous template also built the collection image by hand (Create an array with filename, exportURL, alt, lastChange, type). That row still works, but logs a missing file name for every collection without an image; the Send Shopify media row is skipped in that case.

Collection image built by hand in the previous template

Deleting collections

The datamap collectionsDelete reads the same data as the collection export, so it is deactivated: otherwise every collection export would create the collections and delete them again. For a delete run, activate it and deactivate collectionsUpdateCreate, run the collections job, then switch both back.

The deactivated collectionsDelete node mapping

Important: only collections with the PIM identifier metafield are deleted. The uploaded image stays in Content > Files.

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