Skip to content

Instantly share code, notes, and snippets.

@joe-dempsey
Created May 8, 2017 11:28
Show Gist options
  • Select an option

  • Save joe-dempsey/e35813c7a4043017ce3ed0db19ae802c to your computer and use it in GitHub Desktop.

Select an option

Save joe-dempsey/e35813c7a4043017ce3ed0db19ae802c to your computer and use it in GitHub Desktop.
Shopify autofil checkout fields
Turns out you can construct the URL like this to autofill the fields:
checkoutUrl = variant.checkoutUrl()
checkoutUrl += "&checkout[email]=#{email}" +
"&checkout[billing_address][first_name]=#{firstName}" +
"&checkout[billing_address][last_name]=#{lastName}" +
"&checkout[billing_address][address1]=#{address}" +
"&checkout[billing_address][city]=#{city}" +
"&checkout[billing_address][country]=#{country}" +
"&checkout[billing_address][zip]=#{postalCode}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment