Shopify » Reference fields

A Shopify Reference field works similar to the ACF reference type From an editor perspective. there is no functional difference, but the Liquid code now returns the referenced object directly without the need to do a lookup via a global object using a handle. So for example a Product reference returns the referenced product directly:

{% assign ref_product = product.metafields.accentuate.ref_product.value %}
<p>The referenced product is {{ ref_product.title }}</p>

If you are referencing a file or an image from your Files list in Shopify, you can get the associated URL using the Liquid filters file_url and file_img_url:

{% assign url = product.metafields.accentuate.ref_file.value | file_url %}
<p>The referenced file is {{ url }}</p>

Shopify reference field values cannot successfully be transferred to other stores due to the use of internal Shopify ids, which will vary across stores.

However, using ACF, you can choose to export Shopify Product references and Shopify Collection references using their respective handles, which you can then import into another store assuming the handles match across your stores.

Last updated