Skip to content

How to set primary billing & shipping address? #3304

Closed Answered by lukeholder
johndwells asked this question in Q&A
Discussion options

You must be logged in to vote

You would submit isPrimaryBilling or isPrimaryShipping param to the users/save-address action when saving the current users address. This is mentioned in the https://craftcms.com/docs/commerce/4.x/upgrading.html#saving-an-address
and here https://craftcms.com/docs/commerce/4.x/addresses.html#primary-billing-shipping-addresses

The (optional) makePrimaryShippingAddress and makePrimaryBillingAddress params are now isPrimaryShipping and isPrimaryBilling.

It was never possible to update the primary address IDs preference on a customer save previously (only on address save or cart address save), but it looks like it should be possible to make it possible in Commerce 4. I will look into that now.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by lukeholder
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants