Initial Question:
Users discovered new ‘Category Metafields’ in Shopify’s product creation interface (shown via screenshot) but couldn’t find documentation on accessing these values in Liquid code.
Early Responses:
Shopify Support initially confirmed these metafields were not accessible via Liquid or other means
Support indicated they might consider adding this functionality in the future
Some confusion arose around using product_option_value.swatch.color for color swatches, but this relates to product options, not category metafields
Solution Provided:
Category metafields are accessible through the shopify namespace:
Navigate to admin.shopify.com/store/<store name>/settings/custom_data/product/metafields to find the namespace, key, and return type
Access via standard metafield syntax: product.metafields.shopify.[key].value
Key Clarification:
Category metafields and product options are separate features, though they may display similar names if linked. The confusion stemmed from conflating these two distinct Shopify features.
Summarized with AI on October 29.
AI used: claude-sonnet-4-5-20250929.
My question is: how do I access the value of this in Liquid? It would be incredibly handy to determine some display functionality based on the product category. But I can’t find anything in the docs or online. Is it simply part of
I believe, dispite the feedback from shopify, that the values can actually be accessed through a “product_option_value”. I only managed to do it with the option Color so far. Maybe its just that this was specifically linked somehow. Anyway. I had to add color swatches to a customer store and could access them through the product_option_value.swatch.color
It looks somewhat like this:
{% unless collection.handle == "fussmatte" %}
{%- for option in card_product.options_with_values -%}
{%- for value in option.values -%}
{% assign variant = value.variant %}
{% if option.name == "Farben" or option.name == "Colors" or option.name == "Color" or option.name == "Farbe" %}
{% endif %}
{% endfor %}
{% endfor %}
{% endunless %}
You can assign a product to a category and then a list of category metafields will become available on the product.
You can access them in the same way as standard metafields, but using the shopify namespace.
To see the namespace, key and return type (in this case metaobject (list)), check the relevant metafield definition here: https://admin.shopify.com/store//settings/custom_data/product/metafields
There is some confusion in these comments around options, which is perhaps because you can link these category metafields to the product options, and they would therefore display the same name, but options and category metafield values are not necessarily linked.