Addresses store shipping and billing information for customers.
Overview
Addresses belong to Customers and are used to store shipping and billing information. A customer can have multiple addresses, with the ability to mark defaults for both shipping and billing. Addresses are linked to a Country and have an optional state string field for storing state or province information.
Addresses
Creating an address
The recommended way to create an address is through the customer relationship.
An address can also be created directly.
Retrieving addresses
Default addresses
Each customer can have one default shipping address and one default billing address. These are controlled by the shipping_default and billing_default boolean fields.
When an address is set as the default, Lunar automatically unsets the previous default for that customer via an observer. There is no need to manually manage this.
Relationships