Shopify » Reference fields

A Shopify Reference field works similarly to the ACF reference type. From an editor's 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>

Last updated