-2

While working with guest checkout in craft I noticed that the "Edit" address links were not available.

I removed {% if currentUser %} from the shipping template to reveal the edit links. Now when editing the billing address it also updates the shipping address - manipulating two different addresses does not seem possible.

This is the code for both edit links:

<a class="edit" href="/shop/checkout/customer/addresses/edit?addressId={{ cart.billingAddressId }}&redirect={{ craft.request.path }}">Edit</a>

enter image description here

4

Guests do not have an address book so editing the address is not the right way to think about it. Logged in users can edit the addresses in their address book, but only one at a time.

If you want the guest user to change their addresses for the current cart, just use the data from the current cart addresses to populate the "commerce/cart/updateCart" form to submit 2 new addresses to the cart.

Let me know if you have further questions in the comments.

To edit a completed order's addresses, see this question: Craft Commerce - Edit Complete Order Address from frontend

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.