All things Shopify and commerce
Hi, I have created a custom form in Shopify using HTML,CSS & Javascript. I want to access the phone number , email Id and name of the currently logged in user in my custom js file, any suggestion on how to do it ?
Have you tried using customer liquid objects? https://shopify.dev/docs/api/liquid/objects/customer
Hi I have checked this, but i want to access the customer data in a custom js file , how to do that ?
You can add customer info like this:
<input type="test" name="firstname" id="form_firstname" value={{customer.first_name}}/>
After that use it's value in js, something like that:
let firstname = document.getElementById("form_firstname").value;
This works on a liquid file but not in custom js and html file, it is returning value as "customer.first_name
"
If this happens also, if you don't use brackets here? value={{customer.first_name}}
Yes , it is still returning the same value and not the actual name
Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025