So I would Like to add a new page to my Shopify website and I have created the page and it asks a few information from the user. My problem is how to save those information on Shopify. I understand PHP and JavaScript but what I do not undrestand is the workflow in Shopify. Where does Shopify store data when my customers enter their information? What language should I use to talk to Shopify database?
If you'd like to ask for extra details on the sign up form for a customer, you may do so following this very simple tutorial from Shopify. It won't require you to reach to any API; just add extra fields to your existing form.
Besides that, the best way that Shopify provides to add additional information to a customer, and in general, to any resource, is through the usage of Metafields. However, you need to use the API to create new ones. That means you'll have your own PHP server running (edit: it can be any language such as NodeJS, Python, Ruby, Java, .NET; I've specified PHP since you've mentioned you work with it)
The workflow could be as per the following: User fills out the form on this new page -> this creates a POST http request to your PHP server -> your code in that server authenticates within the shop (this may come in handy) and makes a POST to the new customer metafields endpoint. Finally, it returns a result so you can handle it from your shopify page.
Please notice you may display metafields directly through Liquid templating engine and you won't need additional code nor to reach out to the API for that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With