How to store customer additional details in meta fields and show them on account page.

Solved
Highlighted
Shopify Partner
28 0 3

Hello,

I am a Shopify developer and have seen a lot of questions asked about how to use meta fields to store additional information of customers and how to retrieve them in the account page.
I know about customer notes but they cant be retrieved on the account page.

I assume that Shopify staff is ignoring these questions so that people can rely on the apps.

But I would like to request all the experienced developers to help me with the syntax that how to get customer data in the meta fields, and how the syntax that how to retrieve this by using customer object/meta fields on the account page. I had a word with some developers and we only know that the way exists to store and retrieve additional information of customers but not aware of the syntax and not able to find an informational source to understand this better.

Also do not suggest any kind of app as I currently do not want to use it.

I am stuck and hoping for help from the community.

Thanks in advance.

 
 
0 Likes
Highlighted
Shopify Expert
9973 110 1784

This is an accepted solution.

Have you taken a look at the API docs for this?
https://shopify.dev/docs/admin-api/rest/reference/metafield

That gives you a pretty good starting place for any calls you need to make. I can understand if you don't want to use existing apps given that you're a dev but you will need to use the API and create your own. Unlike things like line item properties, or order notes, metafields do require the API to add. There is an exception here that you can use the bulk editor in the Admin to add metafields but really that's still using the API.

As for showing it on a customer account page when they log in, that will just take a template tweak. Take a look at the Liquid docs for the syntax:
https://shopify.dev/docs/themes/liquid/reference/objects/metafield

And customer notes are only every intended to be merchant facing so - as you've found - they don't get exposed in Liquid objects.

 

I assume that Shopify staff is ignoring these questions so that people can rely on the apps.

That's not the case at all.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
1 Like
Highlighted
Shopify Partner
28 0 3

Hello @Jason,

Thank you for checking out with this. I highly appreciate your response. And yes I knew that we can store it in the metafields and retrieve by some way. My and I guess many developer's questions is what is the approach of doing this. Are we going to create a metaffield for each customer separate or will push all customers in same. How are metafields going to be connected with the specific customer ?

Should we fire the API on the register button of a form?
I am unable to find any example which shows the approach or any other information that this will going to be executed.

Can you help with that also ?
Any developer who have done this can help us with?

I am stuck and I will highly appreciate your help.

Thanks for hearing me.

0 Likes