New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Billing address saved in profile doesn't show up in checkout form #274
Comments
Hey @QAComet, You can directly use the customer to get the billing address that is saved in the user profile. const customer = await getCustomer()
console.log(customer?.billing_address) Initialize the form data as following code snippet: const [formData, setFormData] = useState({
"billing_address.first_name": cart?.billing_address?.first_name || customer?.billing_address?.first_name || "",
"billing_address.last_name": cart?.billing_address?.last_name || customer?.billing_address?.last_name || "",
...all other values
}) You could also create the similar component like |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
On the user profile page in the account settings, there is a section for setting a default billing address. If a user sets this, I would expect there to be functionality to use this in the billing address section of checkout or filled in as the billing address by default.
Steps to reproduce
/us/account/profile
as an authenticated user/us/store
Suggestions for improvement
There are some ways to improve the situation:
Option 1
This choice is straight forward and just requires filling in the billing address form with the billing address saved in the profile when the user unchecks "Same as billing address"
Option 2
This option is more involved and requires some UX decisions. Not only would there be a change to the address form on the address modal, there should probably also be some indication on the address card that it is the default billing address. If there is already a default address set in either case, the default is changed to the new default address. E.g. have address A as the current default, create address B and toggle the default address, saving this form causes address B to be the default, and removes the default flag from address A
Also, keeping the default addresses first in the addresses list is probably a good idea as well. In addition, the checkout page could have the address dropdown, similar to the Shipping address form if the user unchecks the "Same as billing address" checkbox.
Option 3
In addition to the text before, this "+ New Address" could be a feature for all the address dropdowns. Moreover, the modal could show up on any of these pages as well.
Option 4
You could take any of the suggestions from before and combine them to get a better checkout experience.
The text was updated successfully, but these errors were encountered: