<p>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.</p>

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

<p>The <code>lastBillingAddress</code> and <code>lastShippingAddress</code> have no use for guest checkouts as a new customer will be created for the guest.</p>

CC BY-SA 3.0
2017-03-22T09:23:09.863Z
Thanks Luke, i thought as a newbie, it might be a duplication of records but didn't think about the order edit.
orionlogic
CC BY-SA 3.0
2017-03-22T09:15:58.663Z
2017-03-24T04:58:43.913Z
2017-03-24T04:58:43.913Z
Luke Holder
<p>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). </p>

<p>Is this how it suppose to work?</p>

<plugin-craftcommerce>
About customer address
# About customer address

(Asked by: username_0 on 2017-03-22)

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?

**Tags:** plugin-craftcommerce


---

## 1 answers

### Answer by username_1 on 2017-03-22. Score: 2 | Accepted answer

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.

> **Comments:**
> **username_0**: Thanks Luke, i thought as a newbie, it might be a duplication of records but didn't think about the order edit.  

---

