get_metafield
Gets a metafield object associated with a specific resource by using the namespace and key parameters.
Unlike the get_metafields filter, the get_metafield filter retrieves a metafield object by specifying the namespace and key parameters.
To ensure store performance and responsiveness, the maximum number of times this filter can be called during a single page rendering proccess is 50. When multiple calls include identical input parameters, these calls will be deduplicated and counted as one call. Once the call limit is reached, subsequent calls will return nil.
object | get_metafield(namespace, key) returns a metafield object.
Required Params
-
objectany: The specified resource object. Valid values: product, collection, blog, article, page, order , customer, variant, shop, and company. -
namespacestring: The namespace of the metafield. -
keystring: The unique identifier for the metafield within its namespace.
Example
{{#var mf = product | get_metafield("demo_ns", "demo_key") /}}
{{ mf.value }}