> ## Documentation Index
> Fetch the complete documentation index at: https://docs.digifist.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Addresses

> Customer address book page for managing shipping and billing addresses

## What It Does

The **Addresses Page** template displays when logged-in customers navigate to `/account/addresses` to manage saved shipping and billing addresses. Customers can add new addresses, edit existing ones, set a default address, and delete old addresses.

<Note>
  This is a **static template section** with no customizable settings. Address management functionality is standard Shopify behavior. Customization requires code editing.
</Note>

## Template Content

### Default Address Management Interface

**Typical addresses page includes:**

* **Heading** - "Addresses" or "Address Book"
* **Add new address button** - Opens form to add address
* **Saved addresses list** - All customer's saved addresses displayed as cards
* **Default address indicator** - Badge/label showing default shipping address
* **Edit button** (per address) - Edit address details
* **Delete button** (per address) - Remove address from account
* **"Set as default" button** (per address) - Make this the default address

### Address Card Display

**Each saved address shows:**

* Name (First + Last)
* Address line 1
* Address line 2 (if provided)
* City, Province/State, Zip/Postal code
* Country
* Phone number (if provided)
* Default badge (if default address)

## User Experience

**Managing addresses flow:**

1. Customer logs in, navigates to account
2. Clicks "Addresses" in account navigation
3. Lands on addresses page (`/account/addresses`)
4. Views all saved addresses
5. Clicks "Add new address" → Fills form → Saves
6. Or clicks "Edit" on existing address → Updates fields → Saves
7. Or clicks "Delete" on address → Confirms deletion
8. Or clicks "Set as default" → Address marked as default for checkout

## Best practices

<CardGroup cols={2}>
  <Card title="Add Address Button Prominent" icon="plus">
    "Add new address" button should be easily found (top of page or prominent position). Customers need clear way to add addresses.
  </Card>

  <Card title="Default Address Clear" icon="star">
    Clearly mark default address (badge, icon, different styling). Customers should know which address is used at checkout.
  </Card>

  <Card title="Edit vs Delete" icon="pen-to-square">
    Make edit/delete buttons visually distinct. Prevent accidental deletions (use confirmation modal for delete).
  </Card>

  <Card title="Address Validation" icon="circle-check">
    Validate addresses on save (correct format, valid zip code). Reduces shipping errors, returns.
  </Card>

  <Card title="Mobile-Optimized" icon="mobile">
    Address forms often used on mobile. Ensure form inputs large, easy to tap, appropriate keyboard types (number pad for zip code).
  </Card>

  <Card title="Multiple Addresses Supported" icon="location-dot">
    No hard limit on saved addresses. Customers can save home, work, gift recipient addresses without deleting old ones.
  </Card>

  <Card title="Pre-Fill Forms" icon="fill">
    When editing, pre-fill form with existing address data. Customers only update changed fields.
  </Card>

  <Card title="Success Messages" icon="circle-check">
    Show confirmation after add/edit/delete ("Address saved!", "Address deleted"). Provides feedback.
  </Card>
</CardGroup>

## Address Form Fields

### Standard Fields

**Required fields:**

* First name
* Last name
* Address line 1
* City
* Country
* Province/State (if applicable to country)
* Zip/Postal code

**Optional fields:**

* Address line 2 (apartment, suite, unit)
* Company (for business addresses)
* Phone number

**Auto-populated:**

* Country (defaults to store's primary country)
* Province/State dropdown (populated based on country selection)

## Related Pages

* **[Account Dashboard](/themes/mojave/pages-templates/customers/account)** - Account hub (links to Addresses page)
* **[Orders Page](/themes/mojave/pages-templates/customers/order)** - Order history (uses saved addresses for shipping)
* **[Checkout](/themes/mojave/checkout)** - Checkout uses default address (or customer selects from saved addresses)

## Technical Notes

### Default Address

**Behavior:**

* First address added automatically becomes default
* Default address pre-selected at checkout (customer can change)
* Only one default address per customer
* Setting new default removes default status from previous address

**Checkout integration:**

* At checkout, default address auto-fills shipping address form
* Customer can select different saved address from dropdown/list
* Or enter new address (can save to account during checkout)

### Address Limits

**No hard limit:**

* Customers can save unlimited addresses (practical limit \~20-30)
* No Shopify-imposed maximum
* Theme typically displays all addresses (may paginate if many)

### Address Data Storage

**Stored in customer object:**

* Addresses saved to customer account in Shopify database
* Accessible via Liquid customer object: `{{ customer.addresses }}`
* Persists across sessions (saved until customer deletes)

### Address Validation

**Shopify provides:**

* Basic validation (required fields, format checking)
* Province/State validation (must match selected country)
* Zip/Postal code format validation (country-specific)

**Advanced validation:**

* Requires apps or custom code (e.g., Google Address Validation API)
* Verifies address exists, suggests corrections

### Edit vs Delete

**Edit:**

* Opens pre-filled form with address data
* Customer updates fields
* Saves changes (overwrites old address, same ID)

**Delete:**

* Removes address from customer account
* Cannot be undone (customer must re-add if mistake)
* If deleting default address, another address becomes default (or no default if last address)

## Troubleshooting

**Can't add new address:**

* Verify all required fields filled (First name, Last name, Address 1, City, Country, Province, Zip)
* Check zip/postal code format (must match country's format—e.g., US 12345 or 12345-6789)
* Province/State may not match country (re-select country first, then province)
* Browser console errors? May be JavaScript issue (refresh page, try different browser)

**Address not saving:**

* Check internet connection (must be online to save)
* Try submitting again (may have been temporary server issue)
* Verify logged in (session may have expired—log back in)
* Check browser console for errors (may be theme bug)

**Can't edit address:**

* Try deleting and re-adding (workaround if edit broken)
* Check theme supports address editing (older themes may have bugs)
* Clear browser cache, try again
* Contact theme support if persists

**Can't delete address:**

* Some themes don't allow deleting default address (set different default first, then delete)
* Try hard refresh (Cmd/Ctrl+Shift+R)
* Check theme code supports delete (older themes may not have delete button)

**Default address not applying at checkout:**

* Verify address set as default (badge/star indicator on address)
* Try setting default again (may not have saved properly)
* Clear browser cookies, log in again
* Check checkout page refreshed (may be showing cached address)

**Province/State dropdown empty:**

* Select country first (province dropdown populates based on country)
* Some countries don't have provinces (dropdown doesn't appear—normal)
* If country has provinces but dropdown empty, may be theme bug

**Address format looks wrong:**

* Different countries have different formats (US vs UK vs Japan address formats)
* Shopify auto-formats based on country selection
* If incorrect, may need to manually format in form (or contact theme developer)

**Mobile form not working:**

* Check form inputs large enough to tap (48x48px minimum)
* Ensure correct keyboard type (number pad for zip code, full keyboard for address)
* Test on actual device (browser mobile emulation may not match real behavior)

## Key Takeaways

* **No template settings** - Addresses page is static, no customization in Theme Customizer
* **Manage shipping addresses** - Add, edit, delete, set default address
* **Default address used at checkout** - Pre-fills shipping address form (customer can change)
* **No limit on saved addresses** - Customers can save unlimited addresses (home, work, gifts)
* **Required fields** - Name, address line 1, city, country, province, zip/postal code
* **First address is default** - Automatically becomes default when added (change later)
* **Edit pre-fills form** - Existing address data populates form for easy updating
* **Delete requires confirmation** - Prevent accidental address deletion
* **Mobile-optimized** - Form inputs should be large, easy to tap on mobile
* **Customization via code** - Modify layout or add features via theme code editing

For custom address book features (address validation, auto-complete, custom fields), explore Shopify apps or hire a developer.
