Scope

Metafields aren’t just for products; they can be attached almost anywhere in your Shopify store.

The part of your store where a Metafield lives is called a scope. Understanding scopes is key to using Accentuate Custom Fields (ACF) effectively, whether you're creating global data, organizing vendor-specific information or referencing Metafields across multiple areas of your store.

However, throughout our help articles, we use examples showcasing Metafields for the product scope, i.e., custom fields for products. This is done to maintain consistency between the different code snippets.

Shopify’s default scopes

Please know that every example that uses the product scope can just as well use any of the other 8 scopes available:

  • Variant (product.variants)

  • Collection

  • Page

  • Blog

  • Article

  • Order

  • Customer

  • Shop (anything related to the store as a whole)

These scopes let you manage and present content in many parts of your store, supporting a diverse range of use cases. For example:

  • Products and variants: burn time, materials, sizing

  • Collections: banners or seasonal tips

  • Pages: custom blocks or messages

  • Articles and blogs: author bios, related links

  • Orders: gift messages or delivery instructions

  • Customers: loyalty tiers, preferences

  • Shop: disclaimers or return policies

Global fields

Global fields in ACF work similarly to shop fields and the two can be used interchangeably.

The key difference lies in how you can use them: global fields can be referenced from field definitions in other scopes (like products, collections, or pages) using the “Global reference” field type, while shop fields are used directly without referencing. This allows you to use global fields as puzzle pieces for building your field definitions for a specific scope, making it a breeze to maintain cross-site content of any type. You define and edit global fields as you would for any other scope in ACF. This allows you to store content globally available (within your shop, that is).

Custom fields for the global scope are saved as shop-level Metafields and have their namespace locked to globals. You cannot create global fields with another namespace and you cannot use the globals namespace for shop-level custom fields.

Extra scopes available via Accentuate (Aggregate scopes)

ACF goes further by supporting the creation of custom fields for Shopify-specific entities that aren’t officially available for Metafields but are incredibly useful.

For each of these scopes, you can define custom fields as usual and edit the values for each just as you would for a product or a collection in ACF. These entities or "aggregate scopes" are:

  • Vendors – useful for adding vendor-specific information, like logos or warranty policies

  • Locations – ideal for warehouse data, working hours, contact data or logistics-related info

  • Product types – helpful for naming or grouping items by custom categories or styles (e.g., tagging all men’s long-sleeve shirts as “LSM”)

They help you to store content where it makes the most sense to you because aggregate scopes allow you to define custom fields for higher-level grouping and content organization.

Custom fields for aggregate scopes are stored with the "shop" scope in Shopify and have their namespaces locked to a specific value depending on the scope:

  • types is a reserved namespace for product type fields

  • vendors is a reserved namespace for vendor fields

  • locations is a reserved namespace for location fields

You cannot create product type, vendor or location fields with other namespaces than the above and you cannot use these namespaces for other shop-level custom fields.

Accessing Metafields in Liquid

Every scope has a different Liquid syntax. Let’s take a look at examples of Metafields in action:

Standard scopes

{{ product.metafields.accentuate.my_custom_field }}

This is a Liquid code snippet used in Shopify themes to retrieve and display a custom field (Metafield) value.

Let’s break it down:

  • product: refers to the scope of your Metafield

  • metafields: This is the container where all custom data will be stored

  • accentuate: This is the namespace used to group Metafields created by the Accentuate Custom Fields app. Think of it like a folder name

  • my_custom_field: This is the key (label) of the specific Metafield you created, a unique identifier for the data you want to access (like subtitle, feature_icon or care_instructions)

{{ page.metafields.accentuate.my_custom_field }}
{{ collection.metafields.accentuate.my_custom_field }}

Aggregate scopes

To access a custom field value for an individual product type, use this construct:

shop.metafields.types.my_field_name['cars'] 

Similarly for vendors:

shop.metafields.vendors.my_field_name['microsoft']

Note: the value used as the last parameter for types and vendors must be a handleized value. These shop-level Metafield constructs work in a similar way as Liquid's global objects "all_products", "collections" etc.

Access to Metafields for locations follows the same general principle but uses Shopify's internal id numbers for its location objects. You don't have direct access to your shop's locations from Liquid, but you can copy a specific location's id from your shop's admin interface and use it to access the location's custom field:

shop.metafields.locations.my_field_name[1234567890]  

Extra examples

Showing the vendor's logo (stored in a Media v2 field) when viewing a specific product:

{% assign vendor_handle = product.vendor | handleize %}
{% assign logo = shop.metafields.vendors.logo[vendor_handle] | first %} 

<img src="{{ logo.src }}" alt="{{ logo.alt }}"/>

Showing a product's type's care instructions when viewing a specific product:

{% assign product_type_handle = product.type | handleize %}

<p>{{ shop.metafields.types.care_instructions[product_type_handle] }}</p>

Last updated