Calling a product custom metafield in liquid

Calling a product custom metafield in liquid

Anchoright
Excursionist
24 0 4

Hi

 

I've raised a product custom metafield and am now trying to call it into a label in Shopify Order Printer using the below liquid but am getting no values returned

 

{{ product.metafields.custom.packed_in }}

 

There are values against the product.

 

Below is the setup for the metafield

Anchoright_0-1745571242135.png

 

Any suggestions?

Replies 3 (3)

TheScriptFlow
Shopify Partner
709 49 95

This could be happen because of the several resons some are the below.

  • First you need to verify either your metafield namespace is exactly "custom" (case sensitive).
  • Verify the metafield key is exactly "packed_in"
  • Verify your access methods. If it's not work then try this instead.
{{ product.metafields.custom["packed_in"] }}
{{ product.metafields["custom"]["packed_in"] }}
  • Confirm either you accessing the correct product object.

By verify these steps you will be able to resolve the issue that you facing.

If you need further help then let me know.

Thanks

- Need a Shopify Specialist? Chat on WhatsApp Or Email at info@thescriptflow.com

- Boost Your Sales with Affiliate Marketing - UpPromote: Affiliate & Referral


- If my solution was helpful, mark it as a solution and hit the like button! And Wait Don't forget to Buy me a Coffee

Anchoright
Excursionist
24 0 4

Hi , thanks for taking the time to respond. The metafield name was cut and paste from the metafield setup screen to guarantee it's been input correctly, so that's definitely correct. I've tried the [] approach but that's not worked either.

 

I've just noted that I cannot seem to pull any product values at all.

mikialem
Tourist
5 0 1

Hi, I am experiencing the same issue. I am trying to extract product custom meta fields using a python script via the API. I can extract the product ID but not the meta fields, even though the meta fields exist and even pinned on the product page. These meta fields that I couldn't access are of the rich text type, but I can access some meta fields that are multi line text type. I have posted this issue on the community page, didn't get a reply yet.