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
-
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.
-
Open the customers/account.liquid file and find the section where you want to display the custom messaging for VIP customers.
-
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?

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 }}