Showing Customer Metafields on Customer Account Page

Topic summary

Goal: show VIP-specific messaging on the classic customer account page using customer metafields.

What was done: a customer metafield definition was created with Storefront read access. The file to modify is customers/account.liquid. A suggested pattern is to conditionally render the metafield, e.g., customer.metafields.[namespace].vip_status.

Key guidance:

  • Edit customers/account.liquid and place conditional output where the message should appear.
  • Use the correct namespace and key. Example: {% if customer.metafields.namespace.vip_status %} {{ customer.metafields.namespace.vip_status }} {% endif %}.
  • For certain metafield types (e.g., references, URLs), assign and access the .value before rendering. Example: {% assign entries = customer.metafields.custom.entries.value %} {{ entries }}.

Latest update: the basic display now works for the OP, but they need to output a URL stored in a metafield. Screenshots were attached for context. The recommendation is to assign the metafield and use .value, then render it (and wrap it in an anchor tag if needed).

Status: partially resolved; URL rendering specifics remain open.

Summarized with AI on December 25. AI used: gpt-5.

Hi just wondering if anyone can help me with customer metafields.

I have VIP customers that I want to show specific messaging to on the their classic account page. So far I have created a custom metafield definition (ensuring that i selected read storefront)

I tried this on a test customer account but I am stuck on how to get the metafield information to show to them on their account page.

Please help!

1 Like
  1. In the theme editor, locate the template file responsible for rendering the customer account page. This file is typically named customers/account.liquid or similar.

  2. Open the customers/account.liquid file and find the section where you want to display the custom messaging for VIP customers.

  3. Within that section, you’ll need to add code to fetch and display the custom metafield information for the logged-in customer.

    Here’s an example of how you can retrieve and display a specific metafield (assuming you have a metafield named “vip_status”):

{% if customer.metafields.namespace.vip_status %}
  

{{ customer.metafields.namespace.vip_status }}

{% endif %}

Thanks for that but I did get it to work, however how do I get the meta field to show to URL?

niki92bgd_2-1686852215215.png

In order to display metafield (or metaobject values), sometimes you have to assign them as a variable first.

{% assign entries = customer.metafields.custom.entries.value %}

Total Entries: {{ entries }}