2

When i use lastUsedShippingAddress it populates the last customer order address. However when the order is complete, database create new customer address (same info but with different ids).

Is this how it suppose to work?

2

When the order is completed, duplicates of the the shipping and billing addresses that were used during checkout are created, and then related only to the Order. This means that editing the address from the order edit screen does not edit the address in the customer address book.

The address IDs that the customer selected (before address duplication) when checking out are the ones saved as the lastBillingAddress and lastShippingAddress on the customer. This enables you to set them as defaults for the next time the user checks out.

The lastBillingAddress and lastShippingAddress have no use for guest checkouts as a new customer will be created for the guest.

1
  • Thanks Luke, i thought as a newbie, it might be a duplication of records but didn't think about the order edit.
    – orionlogic
    Mar 22 '17 at 9:23

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.