CMS Properties for Shopify Products

Which properties are available in the Shopify Products external CMS collection?

Updated this week

This document is a guide for developers. If you do not have access to a developer, please refer to Shogun's list of recommended partners and services.

Accounts with access to the CMS feature include an external CMS collection named "Shopify Products." This CMS collection pulls various product properties from the store's catalog and makes them available for use in Custom Elements.

The following properties are available in this external CMS collection. The following properties are available in this CMS collection. The data source on the custom element must be set to "Shopify Products" in order for the product data to be displayed.

General Product Details

Basic details about the product include:

  • body_html

  • created_at

  • handle

  • id

  • product_type

  • published_at

  • published_scope

  • status

  • tags

  • template_suffix

  • title

  • updated_at

  • vendor

Main Product Image Properties

Values for the main image of the product are available in the image nested object.

  • image.alt

  • image.height

  • image.id

  • image.product_id

  • image.src

  • image.variant_ids

  • image.width

All Product Images

Values for all of the images that have been uploaded for a product are available in the images nested object.

  • images.alt

  • images.height

  • images.id

  • images.position

  • images.product_id

  • images.src

  • images.variant_ids

  • images.width

Product Metafields

The custom metafields of the product are available as a nested object.

  • metafields.key

  • metafields.value

Example: {{product.metafields[0].value}} will display the value of the product's first metafield.

You can also use a for loop to access a metafield by the name of its key:

{% for field in product.metafields %} 
{% if field.key == 'badge' %}
<strong>{{field.key}}:</strong> {{field.value}}
{% endif %}
{% endfor %}

Note: In order to display metafield data, Shogun must have permissions at access the metafields in your Shopify account. If you installed Shogun prior to September 27, 2023, you will need to update your app permissions. If you installed after September 27, 2023, no further action is needed.

Product Options

The options of the product are available as a nested object.

  • options.id

  • options.name

  • options.position

  • options.product_id

  • options.values

Product Variants

The properties of variants for the product are available as a nested object.

  • variants.barcode

  • variants.compare_at_price

  • variants.fulfillment_service

  • variants.grams

  • variants.id

  • variants.image_id

  • variants.inventory_item_id

  • variants.inventory_management

  • variants.inventory_policy

  • variants.inventory_quantity

  • variants.position

  • variants.price

  • variants.product_id

  • variants.requires_shipping

  • variants.sku

  • variants.taxable

  • variants.title

  • variants.weight

  • variants.weight_unit

Example: {{product.variants[0].price}} will display the price of the product's first variant. Please note: the currency symbol is not included with the price, so you'll want to add one before the price variable in your custom element code: ${{product.variants[0].price}}


Related articles:

Did this answer your question?