metafield
A metafield attached to a specific resource (such as a product or order).
For more information on how to access a metafield on a resource, refer to get_metafield and get_metafields.
Metafields support various data types. To format or render a metafield, use the metafield_text filter and the metafield_tag tag.
Properties
Whether the value of the metafield is a list.
true: The value of the metafield is a list.false: The value of the metafield is not a list.
The type of the metafield.
| Valid values | Description |
|---|---|
| single_line_text_field | Single-line text |
| multi_line_text_field | Multi-line text |
| rich_text_field | Rich text |
| product_reference | Product |
| collection_reference | Product collection |
| variant_reference | Product variant |
| page_reference | Page |
| article_reference | Blog article |
| file_reference | File |
| number_integer | Integer |
| number_decimal | Decimal |
| date | Date |
| date_time | Date and time |
| url | URL |
| link | Link |
| json | JSON |
| boolean | Boolean |
| color | Color |
| weight | Weight |
| volume | Volume |
| dimension | Dimension |
| rating | Rating |
| money | Money |
| metaobject | Metaobject |
The value of the metafield.
The following table lists the supported value format for each metafield type:
| Type | Return value format |
|---|---|
| A string |
| Rich text (supports headings, lists, bold, italics, and links) |
| A product object |
| A collection object |
| A variant object |
| A page object |
| An article object |
| One of the following: |
| A number |
| A date string (can be formatted using the date filter) |
| A URL string |
| A link object |
| A JSON object |
| A boolean value |
| A color object |
| A measurement object |
| A rating object |
| A money object |
| A metaobject object |