Access field definitions
For each of the scopes, ACF offers custom fields for, selected properties from the custom fields definitions are surfaced to a special Metafield for you to use in your theme with Liquid. You can query the defined labels, the instructions, etc. or show your custom fields on the storefront in the same order as defined in ACF.
Metafields
If any custom fields have been created for the scope, the following Metafields are available: shop.metafields.acf_settings.product shop.metafields.acf_settings.variant shop.metafields.acf_settings.collection shop.metafields.acf_settings.page shop.metafields.acf_settings.blog shop.metafields.acf_settings.article shop.metafields.acf_settings.order shop.metafields.acf_settings.customer shop.metafields.acf_settings.shop shop.metafields.acf_settings.product_type shop.metafields.acf_settings.vendor shop.metafields.acf_settings.location shop.metafields.acf_settings.global
Each of these Metafields contains a fields array containing the defined fields - excluding any sections.
Properties
Each element in the fields array has the following properties:
name
The name defined for the custom field. This is used as the key property in the Metafields created for each value.
namespace
The namespace defined for the custom field. This is used as the namespace property in the Metafields created for each value.
type
The type of field (text, checkbox, etc.).
label
The label defined for the custom field, which is also used in the ACF editor.
instructions
These are the same instructions as shown in the ACF editor (with any Markdown translated into HTML). When using these on the storefront, take care that they are not authored for internal use.
repeatable
A boolean true if the field is defined as repeatable.
value
Depends on the type of field. For example, for a Media field, the value will be a pipe-separated list of MIME types, or for a Selection field a pipe-separated list of options.
allow_multiple
A boolean true if the field allows for multiple selections.
section
If this field belongs to a section, you will find an id property for that section as well as a label property with the section's label. The id property is a unique internal id, that allows you to logically discern which fields belong to different sections.
Examples
Showing the label for the field "size" before the field value:
Listing custom fields in the same order as defined in ACF:
Listing custom fields with section headers:
Getting the entry for a specific field:
Last updated