Metafield data are not showing up in the site

Hi,

With Shopify SDK and API, I was able to generate a couple of metafields and the below is the array that I printed after successful creation and updating of the metafield value.

Array
(
    [id] => 28932645388592
    [namespace] => reflectperfection
    [key] => logo_tag
    [value] => Test
    [description] => 
    [owner_id] => 73156460848
    [created_at] => 2023-06-16T08:33:42-07:00
    [updated_at] => 2023-06-17T06:54:35-07:00
    [owner_resource] => shop
    [type] => string
    [admin_graphql_api_id] => gid://shopify/Metafield/28932645388592
)
Array
(
    [id] => 28932646109488
    [namespace] => reflectperfection
    [key] => logo_date_info
    [value] => Test
    [description] => 
    [owner_id] => 73156460848
    [created_at] => 2023-06-16T08:36:00-07:00
    [updated_at] => 2023-06-17T06:54:35-07:00
    [owner_resource] => shop
    [type] => string
    [admin_graphql_api_id] => gid://shopify/Metafield/28932646109488
)

However, trying to print these metafield data in header.liquid file is printing nothin as if these fields were never created or updated. We are not using any metafield app and I don’t know if there is a way to view these newly created metafields(Via API) in Shopify admin. Code in header.liquid is as follows.

    {%- assign eventDate = '' -%}
    {%- if shop.metafields.reflectperfection.logo_tag != "normal" -%}
      {% assign sourceLogoTagUppercase = **shop.metafields.reflectperfection.logo_tag** | upcase %}
      {%- assign sourceLogoFile = 'logo' | append: sourceLogoTagUppercase | append: '.png' -%}
      {%- if **shop.metafields.reflectperfection.logo_date_info** != "normal" -%}
        {%- assign eventDate = shop.metafields.reflectperfection.logo_date_info -%}
      {%- endif -%}
    {%- endif -%}

Hi @pramodraam ,

As I can see in your liquid code you have assigned variables but you did not used to print the data.

For example :

I have created one product metafield(referenced metafield) and printed this metafield data in header.liquid. I got the result.

Code to display in liquid :

{% assign referenced_product = product.metafields.custom.upsell1.value %}
    {%- if referenced_product != blank -%}
           {{ referenced_product.title }}
    {%- endif -%}

Please refer the screenshot.

I hope this will resolve your issue.

If you want more assistance please feel free to ask your queries.

Thanks..