I need to change the metafield in the Custom data in shopify in the shopify theme template, I can create the metafield in advance and just need to be able to read it and modify it!
For example: I have a customer birthday metafield right now, I need to make it possible for the customer to select the birthday in the theme and then update it to the customer metafield
PS: front-end engineers, back-end knowledge is very empty, so how to involve the back-end please tell me a little more detailed, thank you!
Perfect! Let’s go ahead and build the full solution and logic for reading and updating a customer birthday metafield using Shopify theme code and frontend JavaScript (no app proxy yet). This will be entirely front-end based, meant for logged-in customers.
Goal:
Allow logged-in customers to:
View their saved birthday.
Edit and save it using a form in the customer account page.
Save the data to a customer metafield: custom.birthday.
Step 1: Create the Customer Metafield in Shopify Admin