Skip to content
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

Sync changes to address book address to applicable carts #3182

Merged
merged 13 commits into from
Jun 16, 2023

Conversation

nfourtythree
Copy link
Contributor

@nfourtythree nfourtythree commented Jun 1, 2023

Description

By setting the syncAddressBookChanges config setting to true, when a user saves an address in their address book that is being used as a source address for a cart (sourceBillingAddressId, sourceShippingAddressId) the respective addresses will be updated on the cart.

This new setting is false by default to preserve the current behaviour in Commerce 4 and not cause any issues for developers/project owners when updating.

When updating an address in a user's address book, if that user's address is used as a source address on any carts. These carts should be updated with the new address details.

Related issues

#3178

@nfourtythree nfourtythree self-assigned this Jun 1, 2023
@bossanova808
Copy link
Contributor

I may well be misreading this, but this feels a little bit the wrong way around to me. The idea is, if a user changes an address they are using for a cart, that change is then automatically propagated back to the address book. That is because, naturally, people will load and use (and edit) addresses, during checkout, as the most common flow (& I am currently implementing this with a call to save-address).

Here it seems like you're implementing something else - if they change an address in their address book, whilst it is set on the cart, it should change there too. I suppose that is true, too - albeit it will be a relatively unusual flow.

@nfourtythree nfourtythree marked this pull request as ready for review June 14, 2023 10:01
@nfourtythree nfourtythree requested a review from a team as a code owner June 14, 2023 10:01
@nfourtythree
Copy link
Contributor Author

Hi @bossanova808

Thank you for your feedback. We are trying to cover the many use cases people have for Commerce. Address books, custom addresses directly on the cart etc.

With this fix, we have hit a spot where those things are all now possible. With users and their address books, this idea is based on how places like Amazon and Shopify deal with their addresses. You are selecting an address from your address book to use on the cart and if you want to update that address, it should happen within the address book system.

If you were to pull down a fresh install of Commerce 4 and take a look at the updated example templates from this PR I think things would start to make more sense. We need to get this information and explanation into the documentation (and examples in there) to do a better job of educating developers on what is possible.

We have definitely taken your point on board and it has caused us to have discussions and make notes internally on what else may or may not be required regarding addresses during checkout in the future.

Thanks!

@bossanova808
Copy link
Contributor

Thanks for the extra info.

Stupid question perhaps, but what is actually the best/recommended way to get a vanilla Commerce install going these days - the Craft starter project doesn't include Commerce, right? Should one use that and then manually add Commerce, or is there a more direct way? (Be nice is there was a Commerce included version, but I don't think that exists?)

@nfourtythree
Copy link
Contributor Author

@bossanova808 the steps you have outlined with the Craft starter will probably be the quickest way currently. A suggestion of a Commerce start is a good idea, will take this back to the team to see if we can add it to the road map.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants