Solved

Checkout Extensibility | Populate Customer Fields

jchops
Shopify Partner
8 1 0

Is it possible to populate the customers email, first name and last name fields during checkout based on the line item properties? Wondering if we can do this via a custom app but as far as I can tell we cannot manipulate the DOM.

Accepted Solution (1)
Liam
Shopify Staff
2731 299 769

This is an accepted solution.

Sorry - yes you're right this only allows you to edit the line items. It looks like the only way to prefill is to pass parameters via a checkout link, but you won't know the parameters until customers perform an action on the storefront. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 8 (8)

Liam
Shopify Staff
2731 299 769

Hi Jchops,

 

I'm not sure how the line item properties would give you data to pre-fill the checkout fields - can you explain the use case further here?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

jchops
Shopify Partner
8 1 0

Hi Liam,

 

Customers fill out this information when adding certain items to their cart.

 

Best,


Jared

Liam
Shopify Staff
2731 299 769

Hi again Jared,

 

Would the Cart Transform API help with achieving this effect?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

jchops
Shopify Partner
8 1 0

Hm, not sure how that would allow us to populate the email, first name and last name of the customers information in checkout?

Liam
Shopify Staff
2731 299 769

This is an accepted solution.

Sorry - yes you're right this only allows you to edit the line items. It looks like the only way to prefill is to pass parameters via a checkout link, but you won't know the parameters until customers perform an action on the storefront. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

jchops
Shopify Partner
8 1 0

Oh! Actually this may work (well a slight variation of it), thank you!

jamalali81
Shopify Partner
23 0 3

Did you manage to solve this?

 

I am trying to dynamically update the shipping address zip code. I have tried this but nothing seems to be happening:

 

await api.applyShippingAddressChange({
type: 'updateShippingAddress',
address: {
zip: state.deliveryArea[1]
}
});

 

Any help would be much appreciated!

Liam
Shopify Staff
2731 299 769

Hi Jamalali81,

 

Currently the method where you pass parameters via a checkout link is the only way to pre-fill fields. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog